I
I
Ilya Andreevich2016-06-25 18:56:31
htaccess
Ilya Andreevich, 2016-06-25 18:56:31

How to set up an htaccess redirect?

Hello. How to set up a redirect of the pages of the old site to new urls according to the condition:

RewriteCond %{HTTP_REFERER} (referer|referer2|referer3)

so that when this condition is met, pages are redirected according to the rule
RewriteRule /page1.html http://site.ru/main1.html [R=301,L]
RewriteRule /page2.html http://site.ru/main2.html [R=301,L]
RewriteRule /page3.html http://site.ru/main3.html [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2016-06-25
@inetof

RewriteRule /page(1).html site.ru/main$1.html [R=301,L]
Try this option, and if it doesn't work right away, then look for the answer here: https://httpd.apache.org/docs/ current/rewrite/intr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question