Answer the question
In order to leave comments, you need to log in
How to get rid of extra characters in url after RewriteRule works?
Bali addresses like site.ru/article? art_id =10
Steel site.ru/article? id =10
You need to redirect from the old ones to the new ones.
I write the following rule:
RewriteCond %{QUERY_STRING} art_id [NC]
RewriteRule .* id [L,R=301]
The rule works, but after the redirect, the symbol %3f appears in the url
:
site.ru/article?id=10%3f
write a rule?
I'm testing so far on the local (OpenServer)
PS. On a combat server (1Gb hoster), the redirect does not work at all. That is, I write something wrong ...
Answer the question
In order to leave comments, you need to log in
RewriteCond %{QUERY_STRING} ^art_(id=.*)
RewriteRule ^(article)$ /$1?%1 [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)art_id\=10($|&)
RewriteRule ^article$ /article\?id=10 [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)art_id\=([0-9]{1,})($|&)
RewriteRule ^article$ /article\?id=%2 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question