Hi !
That is my first post and day with Yii so please be tolerant…
I like beautifull url (and oher useless stuff: L for love ) so let see a little tips to have a nice back-office url.
If you symply add the following code in the htaccess :
RewriteCond %{REQUEST_URI} ^/your_path/backend.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . backend.php
RewriteCond %{REQUEST_URI} !^/your_path/backend.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
you have the rules but you will get an error like ‘Unable to resolve the request’ because Yii also use the $_SERVER[‘REQUEST_URI’] var.
So to make it works you will have to remove the backend path from the $_SERVER[‘REQUEST_URI’] var.
For exemple add the following code in your backend.php :
$tmp_uri = explode("/", $_SERVER['REQUEST_URI']);
$final_uri = "";
for($i = 0; $i < (sizeOf($tmp_uri)-1); $i++) {
if ($i != 2)
$final_uri .= $tmp_uri[$i].'/';
}
$_SERVER['REQUEST_URI'] = $final_uri;