K
K
Kostya Tester2018-07-06 13:37:22
htaccess
Kostya Tester, 2018-07-06 13:37:22

Can't redirect from old pages to new ones?

There are old links like
https://test1.ru/index.php?do=mymod&stantion=s9845...
In .htaccess I made something like this
https://test1.ru/mymod/s9845745/Moscow
Everything works as expected, but there is one thing but. It is not possible to make a 301 redirect from old pages to new ones so that there are no duplicates. If anyone can help with a line of code I would be grateful.
RewriteRule ^mymod/(.*)/(.*)$ index.php?do=mymod&stantion=$1&sity=$2 [L,R=301] . The redirect does the opposite from the new cnc to the old url, I need it the other way around.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-07-06
@dkostia

RewriteCond %{THE_REQUEST} " /index\.php\?do=(mymod)&stantion=([^&]+)&sity=([^ &]+)"
RewriteRule ^ https://test1.ru/%1/%2/%3? [R=301,L,NE]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question