Hi,
I'm am trying to block a group of IP addresses from my store and I have been searching the forum for some instructions on how to do this. I've come across the htaccess deny access method but I'm trying to modify this so visitors from that IP range do not get a "forbidden page" but rather are redirected to for example contactus.html .
Could anyone tell me how I could do this?
Thank you very much in advance.
In .htaccess
after RewriteBase / line
repeat the RewriteCond line for as many IP's you want to do this for
Note, you must escape the periods (dots) in the ip address with a backslash as per example above
after RewriteBase / line
Code: Select all
RewriteCond %{REMOTE_HOST} 123\.456\.789\.123
RewriteCond %{REMOTE_HOST} 123\.456\.789\.123
RewriteCond %{REMOTE_HOST} 123\.456\.789\.123
RewriteRule .* /index.php?route=information/contact [R=301,L]
Note, you must escape the periods (dots) in the ip address with a backslash as per example above
Thanks Simon for helping me out.
I used the code you provided and now my .htaccess file looks like this:
I tested it out with my ip address but it doesn't seem to be working. Am I missing anything? Perhaps something before RewriteEngine On or after the code?
Thank you for your help.
I used the code you provided and now my .htaccess file looks like this:
Code: Select all
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} 123\.123\.123\.123
RewriteRule .* /ip.html [R=301,L]
Thank you for your help.
Who is online
Users browsing this forum: No registered users and 245 guests