Symfony 2 slashes at the end of url

I am getting started with Symfony2 and I still really like the Framework. I only have one problem, all urls are getting a forward slash appended at the end after every link click.

Example:

I'm on: http://symblog.dev/app_dev.php
now the home button points to http://symblog.dev/app_dev.php/

When I click on it, I find myself: http://symblog.dev/app_dev.php/
and there is another slash at the end of the original url, so now: http://symblog.dev/app_dev.php//

this goes on as often as I click the button, causing things like the debug toolbar to crash because the ajax url doesn't match multiple slashes, etc. This happens on every url in the site, not just the ajax debug toolbar.

I hope someone has figured out what the problem is.

Environment

  • vagrant debian 7 vm
  • apache2, php 5.5, OPcache, hhvm
  • mysql 5.5
  • the code lies in the shared folder with all permissions, the host system wins 8.1

Screenshot: http://picload.org/image/cgardll/screenshot2014-08-2320.14.47.png

// I apologize, typos, etc., since I don't speak English

+3


source to share


1 answer


I recommend reading the symfony2 routing documentation: http://symfony.com/doc/current/book/routing.html

This should give you an idea of ​​how routing works in the framework, so you won't face this problem in the future.



Hope this was helpful.

EDIT: Take a look at this as well. http://blog.christian-baer.com/index.php/trailing-slash-in-symfony-route/

0


source







All Articles