Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*rogerbot.*$ [NC,OR]
RewriteRule ^.*.* http://www.googlehammer.com/ [L]
Redirect 301 / http://domain.com [edited by: phranque at 8:37 am (utc) on Oct 10, 2013]
[edit reason] unlinked urls [/edit]
RewriteCond %{HTTP_USER_AGENT} rogerbot [NC]
RewriteRule .* http://example.com/ [R=301,L] RewriteCond %{HTTP_USER_AGENT} ^.*rogerbot.*$ [NC,OR]
Exactly as:
RewriteCond %{HTTP_USER_AGENT} "rogerbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} =rogerbot [NC] RewriteCond %{HTTP_USER_AGENT} ^rogerbot$ [NC]
Will rogerbot read/see the whole file or stop at </Limit>?
Surrounding the CondPattern in double quotes does not result in an exact match,
nonsense.
Agreeing to one and not the other would seem to be a contradiction?
Are you translating or disagreeing?
"rogerbot 1.6.2"
or any other longer string
There are applications of exactly as far beyond blank spaces.
...doesn't matter, I just don't want them to see the redirect...
SetEnvIfNoCase User-Agent .*rogerbot.* bad_bot
Would this better do what I'm looking for?
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*rogerbot.*$ [NC,OR]
RewriteRule ^.*.* http://www.example.com/ [L]
Redirect 301 / http://example.com
seems to be illustrating exactly what I meant. The UA string contains literal spaces. If you don't want to escape them you have to put the whole thing into quotation marks to prevent the space from taking on semantic meaning. You should also, ahem, escape the literal periods. Quotation marks don't turn off Regular Expressions.
Jim and I had this disagreement many times (i. e., the use of quotes and exactly as) in the last years of his participation here.
This goes all the way back to the earliest versions of Apache (I've still lines in place from those earlier days) and they remain functional in the most current versions.
Jim kept quoting the Apache Docs and I kept telling him that in this specific instance the Apache Docs were full of beans (of which there are a few other examples).
do I need to make it a combo with index.php