Rewrite rule for 403

Posted by Jitesh Tukadiya on Pro Webmasters See other posts from Pro Webmasters or by Jitesh Tukadiya
Published on 2013-04-11T09:17:37Z Indexed on 2013/06/26 10:29 UTC
Read the original article Hit count: 180

Filed under:
|

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?

© Pro Webmasters or respective owner

Related posts about apache

Related posts about htaccess