Forum Moderators: open
I don't have access to httpd.conf as it is a web host site but I can use .htaccess.
My .htaccess looks like this (tried all combinations between your and the other recommendation, e.g. escaping the dots, ^, $ but to no avail):
<Limit GET HEAD POST>
SetEnvIfNoCase User-Agent "Indy Library" bad_bot
SetEnvIfNoCase User-Agent "Internet Explore 5.x" bad_bot
SetEnvIf Remote_Addr "195\.154\.174\.[0-9]+" bad_bot
SetEnvIf Remote_Addr "211\.101\.[45]\.[0-9]+" bad_bot
order allow,deny
allow from all
deny from 211.157.
deny from 63.226.18.204
deny from 61.177.
deny from 67.80.16.
Deny from env=bad_bot
</LIMIT>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} xxx.xx.xxx.xxx
RewriteRule ^index\.shtml$ test.shtml [L]
Any ideas? I want to test with my own address before assuming it will work for another site. Reading the apache.org docs makes me none the wiser.
Make sure you've added the anchors and escaped the periods in the IP address as in the example shown. Also, add a preceding slash to "test.shtml"
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^123\.45\.67\.89$
RewriteRule ^index\.shtml$ /test.shtml [L]
Jim
You're a legend! Thanks!
The / before the alternative page did it. The site search has so many examples, but none that I sampled worked because each was trying to do something different.
Here is the final code that works. For a visitor from 123.123.123.123 who comes to my site, the test.shtml page is displayed instead of index.shtml:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.123$
RewriteRule ^index\.shtml$ /test.shtml [L]
- Ash