I've installed FOSUserBundle and I'd like to customize the urls to be /account/login
, /account/register
, /account/logout
instead of /login
, /register
, /logout
I know I can modify the routing config of the bundle, but it doesn't seem to be the proper way.
How to override / change FOSUserBundle's routes
You can override i.e the
/register
route in yourapp/config/routing.yml
by re-declaring it after importing FOSUserBundle's XML routes as resources.... or just change the prefix when importing:
The same goes for
/login
and/logout
:Another way to override login and logout url's
login and logout paths can aswell be configured directly in your
app/config/security.yml
:List of all of FOSUserBundle's routes in YAML format
You can directly change and then include these in your
app/config/routing.yml
( no need to import the ones the bundle provides as resources then) ... or put them all into a single file and include that one as a resource...