Failure Redirection | Htaccess

How can I get the user to be redirected if their IP was mapped when the IP address was refused, for example.

<Limit GET POST PUT> order allow,deny allow from all deny from {removed IP address} </Limit> 

I need them to be redirected to a specific site when they are denied access.

Need help with this.

+4
source share
1 answer

Install a script to handle 403 errors by adding this line to your .htaccess:

 ErrorDocument 403 /forbidden.php 

Then handle the redirect in the script:

 <?php header('Location: http://google.com'); 

Or save everything in .htaccess, which you could do:

 RewriteEngine On RewriteCond %{REMOTE_ADDR} 127.0.0.1 RewriteRule (.*) http://google.com [R] 
+9
source

All Articles