T
T
Templar3d2020-09-08 13:18:23
Apache HTTP Server
Templar3d, 2020-09-08 13:18:23

"And not =" rule for RewriteCond?

Requirements:
Condition = traffic source is "equal to" google and user agent is "not equal": googlebot If the condition is true, then from page "A" we
make a "301 redirect" to page "B"
, and by default page "A" receives a response code of "200".
Now works with "traffic source is equal to google":

RewriteCond %{HTTP_REFERER} ^(.*)\.google\.(.*) [NC]
RewriteRule ^(.*)/super-puper/$ https://example.org/?refcode=z910027635c38753 [L,R]

and you need to add also "and user agent is not equal to": googlebot ""

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-09-08
@Templar3d

RewriteCond %{HTTP_REFERER} ^(.*)\.google\.(.*) [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*googlebot.*$ [NC]
RewriteRule ^(.*)/super-puper/$ https://example.org/?refcode=z910027635c38753 [L,R]

Well, denial is just denial!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question