简体   繁体   中英

Symfony3 + FosUserBundle /login/ instead of /login

I've been experiencing a strange bug lately. When I want to go to /login with the fos_user_security_login route , I'm redirected to /login/ . As a result, I get that message: No route found for "GET /login/"

However, if I operate a php bin/console debug:route , I do get that route :

fos_user_security_login GET|POST ANY ANY /login

But, if I go into @FOSUserBundle/Resources/config/routing/security.xml and that I change the route /login with /login/, it works. There is now way I modify a file in the Vendor folder.

Could somebody explain that extra "/" occurence?

Thank you.

It doesn't look like a Symfony problem but more like Nginx or apache one, you are supposed to get same result with / and without.

Depending of your configurations, I think you should look here : http://symfony.com/doc/current/setup/web_server_configuration.html

Rewrite Rule could help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM