I think that using of two entry scripts makes things more clear. Because otherwise you’ll have to play with GET params and add some logic to index.php (e.g. which config to choose).
About admin module… My humble opinion is: the backend part is a self-sufficient application and it shouldn’t be a module of the frontend. Both parts have different configs, controllers, views, but share models.
But I think an admin module is a good idea too, at least, for not large applications.
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# Make the backend accessible via url: http://site/admin.
RewriteRule ^admin backend.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
When you’ll try to access http://site/admin then backend.php will be executed. Isn’t it?
EDIT: I managed to fix the above error. However it seems that logging in at [color="#000080"]/webapp/admin/login[/color] redirects me to [color="#000080"]/webapp/backend.php[/color] after logging in. Have you got any idea why?
In your backend controllers you should have a controller "SiteController" with action index, just like in the frontend part. It is the main page of your backend.
Seems it is the only case when this happens. If you’ll try to directly go to the login action from the frontend, you’ll be then redirected to backend.php (since nothing is stored in the returnUrl). Try to go to /webapp/admin. Here you will be redirected to login action and after logged in you’ll get back to /webapp/admin.
I just thought you denied access to all controllers’ actions (except site/login), if a user is not logged in. So if he will try to access site/index, he will be redirected to login page.