Symfony: website/backend.php to website/admin

on Monday, March 16, 2009



Here is the solution for rewriting website/backend.php to website/admin and makes the admin area to work.

1. Create a folder "admin" inside "web" folder. Copy here the same .htaccess file and change this line:

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

to:

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

2. Then go to routing file for backend (app/backend/config/routing.yml) and add folder name to all your routes defined there. Ex:

# default rules
homepage:
url: /admin/
param: { module: default, action: index }
.
.
.

3. Set no_script_name to "on" in your backend settings (app/backend/config/settings.yml) file:

prod:
.settings:
no_script_name: on

4. Clear Cache and now you should be able to get to your backend using: http://mydomian.com/admin/ without problems

Hopes you enjoy...!


0 comments:

Post a Comment