Answer the question
In order to leave comments, you need to log in
How to redirect page URL with Get parameters to without GET parameters via htaccess?
Hello! Please help me set up a redirect via .htaccess with the following URLs:
Исходный: /vybiraem-videokartu-pod-materinskuyu-platu-i-protsessor/comment-page-27/?unapproved=4135&moderation-hash=da912872c1d73732f097d0a3349b2920
Конечный: /vybiraem-videokartu-pod-materinskuyu-platu-i-protsessor/
RewriteCond %{QUERY_STRING} ^(.*)comment-page^(.*) [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
Answer the question
In order to leave comments, you need to log in
We need a universal rule that will work for all pages ... But it does not work as it should, it remains
?
a (question mark) at the end of your RewriteRule - this removes all parameters altogether. QSD
, i.e. your second line will look like this:
PS
And, by the way, maybe I didn’t understand something, but you don’t have in , but in . RewriteRule ^(.*)$ /$1?%1%2
comment-page
%{QUERY_STRING}
%{REQUEST_URI}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question