I'm developing a CMS using yii framework. There is a frontend and backend. I want the users to be able to access the backend like this: http://www.mysite.com/admin, right now it is working like this: http://www.mysite.com/admin.php.
For the backend I have defined different section with it's own config, controller and ... and the page for accessing the backend in admin.php
here is my directory structure:
...
admin
--components
--config
---main.php
--controllers
---NewsController.php
---ShowCOntroller.php
---SiteController.php
--models
---LoginForm.php
---News.php
---Show.php
---User.php
--runtime
...
--Views
---layouts
---news
---show
---site
protected
-commands
-data
-extentions
-messages
-migrations
-models
-modules
--image
-runtime
-views
themes
uploads
admin.php
index.php
.htaccess
And here is my .htaccess file:
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule admin admin\.php [T=application/x-httpd-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
</IfModule>