Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:40:37+00:00 2026-06-11T01:40:37+00:00

I have a blog which generates URLs like: /article-name /my-article /other-article Then there is

  • 0

I have a blog which generates URLs like:

/article-name
/my-article
/other-article

Then there is a forum with threads using URLs like:

/thread-name
/my-thread
/what-do-you-think

How can I make router to handle this situation? I don’t want to use any more URL parameters (like /blog/article-name and /forum/thread-name). Best way would be first asking blog controller whether there is an article with this URL and if doesn’t, ask the forum controller. But how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:40:39+00:00Added an answer on June 11, 2026 at 1:40 am

    You have to define your event listener.

    services:
        kernel.listener.subdomain_listener:
            class: Path\To\YourListener\RequestListener
            scope: request
            tags:
               - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
    

    Then, in your RequestListener you should define onKernelRequest() method and put there your route handling, such as

    public function onKernelRequest(GetResponseEvent $event)
    {
        if ($event->getRequestType() !== \Symfony\Component\HttpKernel\HttpKernel::MASTER_REQUEST) {
            return;
        }
    
        //... check if article exists, otherwise forward to blog controller
    }
    

    For additional information about event listeners you could refer to the documenation:

    http://symfony.com/doc/current/cookbook/service_container/event_listener.html
    http://symfony.com/doc/2.0/cookbook/doctrine/event_listeners_subscribers.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a blog application using Ruby on Rails which includes the ability
I have a Django project for a simple blog/forum website I’m building. I’m using
I have a blog which i get about 1200 visits a month lets say
I have on my site a blog-page on which you can add comments. The
I have got a blog in wordpress (www.ashwinm.com) which i am looking to migrate
I have a website which slides to a section called blog in my HTML.
I have a blog (designed with blogger) and there's one problem. If I access
I have a blog installed in www.foo.com/wp/ and would like all requests that go
I have heard of people using slugs for generating clean urls. I have no
I guess it is something like sgen.exe which generates some serialization classes in separate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.