A
A
Anatoly Yashenkin2015-08-03 13:05:51
Apache HTTP Server
Anatoly Yashenkin, 2015-08-03 13:05:51

How to set up a permanent redirect?

There is a link on the server site.ru/message/index.php?id=304
It is necessary to make it so that the following page opens instead:
site.ru/mess/index.php?inter=304
I don’t understand how this can be implemented, it’s simple the redirect turned out, but I can’t change the parameter ....

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anatoly Yashenkin, 2015-08-04
@yasha4u

It worked :)
For anyone interested:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=([^&]+)
RewriteRule ^/?message/index\.php$ /mess/index.php?inter=%1 [L,R= 301]

D
Dimonchik, 2015-08-04
@dimonchik2013

https://www.addedbytes.com/articles/for-beginners/...
see example with {a number}
does not help - in Google "httaccess rewrite rules lang:ru"

S
ShamblerR, 2015-08-05
@ShamblerR

RewriteCond %{REQUEST_URI} ^(.*)/message/(.*)$
RewriteRule ^(.*)$ %1/mess/%2 [R=301,L]

well, don't forget about passing the get parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question