views:

127

answers:

1

My backend URLs look like this:

 mysite.com/backend.php/blog

I'd like to change it to:

 mysite.com/backend/blog

Technically this isn't limited to admin apps, as Symfony grants every application two front controller scripts. But I hate having the script name in URLs and as such I'd like to change it. Is this possible?

Thanks in advance.

+2  A: 

You can add

 #I'm no regular expression expert or mod_rewrite expert, this line probably has some bugs 
 RewriteRule ^backend(.*)$ backend.php [QSA,L]

to your .htaccess file right before

RewriteRule ^(.*)$ index.php [QSA,L]

and that solves 1/2 of your problem. Anything sent to yoursite.com/backend/xxx will be routed through backend.php. The other problem you get is with internal symfony routing. It will interpret yoursite.com/backend/xxx as a request for module "backend" and action "xxx". I'm sure it's not too hard to solve. Good Luck!

sjobe