I'm currently on a project which gave me a small headache after trying to find a solution for a tiny problem I've bumped onto.
At the moment, my application loads my index.php file on every single page request it gets. Inside my index, the application fires-up some basic stuff, sets some variables etc. Well, the thing I'm currently looking for is that I would like to let my server load a different file (for example admin.php) as default. But, this only needs to happen when the url sub-directory is set as http://www.mydomain.com/admin/
So the server needs to handle every little thing exactly the same, but when the route is set as /admin/, its needs to autoload the admin.php instead of the default index.php.
Currently my .htaccess file looks like this
# mod-rewrite engine RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] EDIT: To clear things up and visualize it a bit more:
- http://www.mydomain.com/users/me/logs/ -> index.php
http://www.mydomain.com/admin/users/me/logs/ -> admin.php
http://www.mydomain.com/admin/stackoverflow/questions -> admin.php - http://www.mydomain.com/stackoverflow/questions -> index.php
Inside these two file I load a new Zend_Application (ZF1)