Rewrite rule for 403
- by Jitesh Tukadiya
I have an .htaccess file:
In this file it redirects to index.php in case a file or directory is not found.
My code is as below:
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Everything is working fine with this code. Now when I get Forbidden error(403), I would like it to be redirect to index.php.
Do you have an idea how to write an .htaccess file for this purpose?