SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast doddsey_65's Avatar
    Join Date
    Sep 2010
    Location
    North East UK
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Symfony routing exception for default routes

    I have just installed Symfony2 and created my bundle. I removed the Acme demo bundle and tested my new route "/" which worked fine.

    I then went to config.php and followed the link to _configurator and get the above route error. I also get the same error when trying to load _profiler.

    Here is my route file:

    Code:
    asf_core_homepage:
        pattern:  /
        defaults: { _controller: ASFCoreBundle:Home:index }
    And the Symfony routing_dev file:

    Code:
    _wdt:
        resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
        prefix:   /_wdt
    
    _profiler:
        resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
        prefix:   /_profiler
    
    _configurator:
        resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
        prefix:   /_configurator
    
    _main:
        resource: routing.yml
    Any ideas why this is happening?
    Test and help out with a new
    100% open source forum package: A Simple Forum
    Check the A Simple forum Github Page
    Visit my Github profile to see what I work on.

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by doddsey_65 View Post
    I then went to config.php and followed the link to _configurator and get the above route error.
    Did the error message say anything besides just "routing exception"?

    I could speculate that perhaps you need to use "path" instead of "pattern". But if that's not it, it would be easiest if you could publish a repo that reproduces the issue.
    Last edited by cpradio; Feb 24, 2014 at 18:58.
    "First make it work. Then make it better."

  3. #3
    SitePoint Enthusiast doddsey_65's Avatar
    Join Date
    Sep 2010
    Location
    North East UK
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I forgot to include the full exception (Copy and pasted the post from stack overflow). The full exception is:

    Code:
    NotFoundHttpException: No route found for "GET nfigurator/" (from "http://dev.asimpleforum.com/forum/config.php")
    Just a few things I have tried:

    Removed all routes except _configurator (still wont work)
    wrapped the route prefix in quotes (nope, nothing)

    I have deleted the cache via console app/console cache:clear and removed the folder manually just incase.

    This is from a fresh install of Symfony. Just to make sure I reinstalled Symfony from fresh (with the demo) and went to /hello/carl as per the docs. I get the same exception in this instance:

    Code:
    No route found for "GET o/carl"
    I have pushed the entire code base for the fresh install example to https://github.com/cjmarkham/symfony-bug
    Test and help out with a new
    100% open source forum package: A Simple Forum
    Check the A Simple forum Github Page
    Visit my Github profile to see what I work on.

  4. #4
    SitePoint Enthusiast doddsey_65's Avatar
    Join Date
    Sep 2010
    Location
    North East UK
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On a further note, just incase there was something wrong with the downloaded version I have, I re-downloaded it and still come across the same exception. This hasn't happened before as I clearly remember using these routes when I started learning Symfony. I am trying to convert an entire project over to Symfony. This error isn't stopping me but I would rather know what went wrong now incase it causes troubles later on.
    Test and help out with a new
    100% open source forum package: A Simple Forum
    Check the A Simple forum Github Page
    Visit my Github profile to see what I work on.

  5. #5
    SitePoint Enthusiast doddsey_65's Avatar
    Join Date
    Sep 2010
    Location
    North East UK
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have narrowed it down and it looks like it has nothing to do with symfony. I have it installed in a subfolder of root so I use htaccess to rewrite all requests from /forum to /forum/web

    Code:
    RewriteRule forum/(.*) /forum/web/$1 [L]
    If I point the browser to /forum/app_dev.php it works fine. the error comes from /forum/app_dev.php/_configurator

    But if I skip the rewrite rule and use /forum/web/app_dev.php/_configurator it works fine.
    Test and help out with a new
    100% open source forum package: A Simple Forum
    Check the A Simple forum Github Page
    Visit my Github profile to see what I work on.

  6. #6
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,276
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by doddsey_65 View Post
    "GET nfigurator/" ... "GET o/carl"
    What stands out to me is that the first four characters from both URLs are missing. Since you've already been able to isolate the issue to your rewrite rules, you'll probably need to post your entire htaccess for us to look at.
    "First make it work. Then make it better."

  7. #7
    SitePoint Enthusiast doddsey_65's Avatar
    Join Date
    Sep 2010
    Location
    North East UK
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is the entire htaccess apart from a www redirect at the top

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteCond %{HTTP_HOST} !^dev\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    
    RewriteRule forum/(.*) forum3/web//$1 [L]
    Test and help out with a new
    100% open source forum package: A Simple Forum
    Check the A Simple forum Github Page
    Visit my Github profile to see what I work on.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •