I follow the post of andy_s backend management ( http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior/ )
and use admin.php instead of backend.php in the webroot/, which runs protect/config/back.php
All the url works if i don’t activate the htaccess eg: /webroot/admin.php?r=products, /webroot/admin.php?r=products/admin
I want to get rid of the .php
so i added the htaccess containaing the following
AddDefaultCharset utf-8
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Make the backend accessible via url: http://site/backend.
RewriteRule ^admin admin.php
# If a directory or a file exists, use it directly.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php.
RewriteRule . index.php
and also uncommented the url manager
in the main i have something like this
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
and in the back.php config i have this
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'admin'=>'site/index',
'admin/products'=>'products/index',
),
),
it works with the url /webroot/admin
but does not work with /webroot/admin/products
and also it screws up all the internal page links in the products crud, it no longer link to /webroot/admin.php?r=products/admin,
it removes admin.php in the url, becomes something like this /webroot/products/
anyone can help with configuring these urls??