Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- A Close to perfect .htaccess ban list - Part 2


Wizcrafts - 10:48 pm on Jun 9, 2003 (gmt 0)



Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "Indy Library"
RewriteCond %{HTTP_USER_AGENT} "IUPUI Research Bot"
RewriteRule .* - [F,L]
RewriteRule ^links/partners\.html$ [widgets.com...] [R=301]

Oaf357:

First of all you have two Rewrite conditions that require either OR to match the pattern, so you need to add [or] after Indy Library. Second, spaces in names must be escaped with a backslash, thusly:
Indy\ Library [or]
^IUPUI\ Research\ Bot
Third, drop the L in the rewrite rule; .* - [F]
Fourth, in the last rule you don't need the $ delimiter. It can be retyped as:
Rewrite ^links/partners\.html [widgets.com...] [R=301,L]

It may not require the leading ^ either, but I'm not certain. Try it without the ^ and see if it works using [wannabrowser.com ]. You are really redirecting here, so a "redirect" rule might prove more correct, but I'm not advanced enough to say for sure.

I hope this is helpful
Wiz


Thread source:: http://www.webmasterworld.com/apache/205.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com