Symfony without a slash at the tail

Most-frequently asked question in the channel for symfony:

  1. how to get rid of the slash on the end of the URL DoctrineRouteCollection
  2. why not take the last slash
  3. etc. in the same vein

So you just a snippet of advice:
# To avoid trailing slash problem

"RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]"

Scientific value of the snippet does not represent, but the question really often ask) so that “search and ye shall find”))

Have fun!

About deepak

Name:Deepak Kumar Country:India Education:B.Tech(Mechanical Engg.), MBA(Information Technology) Expertise:ISO, CMMI, ITIL, SQA, SQC, Web Development, Business & System Analysis, Business Process Analysis & Design, E-Business(B2B,B2C), Information Management & Strategy. Technologies:PHP, CSS, JAVA,AJAX, MySQL, Oracle etc. Interested In:Quality Assurance, Freelance Web Development, System Analysis & Friends
This entry was posted in Symfony. Bookmark the permalink.
  • http://topsy.com/www.decentmind.com/2010/07/symfony-without-a-slash-at-the-tail/?utm_source=pingback&utm_campaign=L2 Tweets that mention Symfony without a slash at the tail | DecentMind — Topsy.com

    [...] This post was mentioned on Twitter by Clément, deepak kumar. deepak kumar said: RT @decentmindblog Symfony without a slash at the tail http://bit.ly/93uk5j [...]

  • http://usafpatch.org/usaf-patch/f4-60286-phantom-ii-new-display-veteran-park-short-video F4 60286 Phantom II new display @ Veteran park – short video – Blog About USAF Patch – USAF Patch

    [...] Symfony without a slash at the tail | DecentMind [...]

  • Imran

    Symfony slash trailing might be fixed by updating the routing settings.
    To allow trailing slash in urls in Symfony, add the following line in routing.yml file.

    slash_trail:
    url: /:module/
    param: { action: index }

    It should work.

    cheers :)

  • http://twitter.com/decentmindblog deepak kumar

    Thanks Imran for the alternate suggestion…

  • http://pulse.yahoo.com/_JMJMA2O7F22IX5XGFYN5MDLVFI codecowboy

    This is a) poorly formatted b) does not work

  • http://pulse.yahoo.com/_JMJMA2O7F22IX5XGFYN5MDLVFI codecowboy

    It should be “RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]“

  • Anonymous

    I appreciate your suggestion.

    Thanks
    Deepak

  • http://www.realseocompany.com/our-services/seo-marketing/ SEO Marketing

    Fantastic review mate! i ENJOYED THIS SENSATION to avoid trailing slash problem. I think it’s easy to solve. Keep it up though. Thanks mate! :)

blog comments powered by Disqus