I know this question might have been asked a few times already, but I need a specific solution for CodeIgniter, using an .htaccess file that would send every request to an index_failsafe.php file instead of the normal index.php but ONLY if the url doesn’t start with ‘admin’. Example:
- http://www.myhost.com/admin -> work as usual
- http://www.myhost.com/welcome -> sent to failsafe page
in case 1:
RewriteRule ^.*$ index.php/$1 [L]
in case 2:
RewriteRule ^.*$ index_failsafe.php/$1 [L]
My rewrite conditions are:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Is it possible to do this?
Personally I do it by IP – so I can take my site offline, but I still have full access to it (to test new functions and make sure it is working before bringing back up)
just change !^1.1.1.1 to your current IP. i.e. !^121.65.56.65
If your not sure what your IP is – just google “what is my IP” – and it will show up as the first hit
But in terms of your specific question – this should work:
edit: