Answer the question
In order to leave comments, you need to log in
How to configure htaccess to remove get parameters from only part of the site pages?
The logic should be like this:
site.com/? [any value] -> 301 -> site.com
site.com/page.html?page= [any value] -> 200 Ok
site.com/page.html? [any parameter except page] -> 404 Not found
site.com/items/items.php?art= [any value] -> 200
Ok site.com/items/items.php? [any parameter except art] -> 404 Not
found
RewriteCond %{QUERY_STRING} !^$ [NC]
RewriteCond %{THE_REQUEST} \? [NC]
RewriteCond %{THE_REQUEST} !page [NC]
RewriteRule ^(.*)?(.*)$ http://site.ru/$1? [R=301,L]
But in this case items/items.php?art= doesn't work
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question