Y
Y
Yahya2016-07-20 13:11:29
htaccess
Yahya, 2016-07-20 13:11:29

Redirect 301 with htaccess options?

Good afternoon!
Please tell me how to correctly make redirect 301 with parameters.
For example, site1.ru/?id=1&val=2, when you go to such an address, redirect 301 to such
site2.ru/?id=1&val=2 should work
. Many thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2016-07-20
@gamma06

RewriteEngine on
RewriteRule ^ http://site2.ru [R=301]

Or:
RewriteEngine on
RewriteCond %{QUERY_STRING} id=1&val=2
RewriteRule ^ http://site2.ru [R=301]

Or
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=\d+&val=\d+$
RewriteRule ^ http://site2.ru [R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question