U
U
uaf0x2016-02-28 23:33:03
Apache HTTP Server
uaf0x, 2016-02-28 23:33:03

Is it possible to redirect by User-agent globally in Apache settings?

How to globally manage bots on a server by user-agent
Since there are no clear answers or I'm very stupid, let's get a specific task :)
Yes User-Agent = Mozilla/5.0 (compatible; MJ12bot/v1.4.5; www.majestic12.co.uk/bot. php?+) it needs to be redirected to https://vk.com/ how to do it?
Globally in the Apache settings without touching htaccess on the entire site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shuraosipov, 2016-02-28
@shuraosipov

httpd.apache.org/docs/2.0/misc/rewriteguide.html

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/3.*
RewriteRule ^foo\.html$         foo.NS.html          [L]

RewriteCond %{HTTP_USER_AGENT}  ^Lynx/.*         [OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[12].*
RewriteRule ^foo\.html$         foo.20.html          [L]

RewriteRule ^foo\.html$         foo.32.html          [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question