A
A
Andrey Fedorov2015-09-02 23:57:03
MySQL
Andrey Fedorov, 2015-09-02 23:57:03

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

1 answer(s)
D
Dimonchik, 2019-03-22
@dimonchik2013

little text
but you can start with

Could not set the file size of './ibtmp1'. Probably out of disk space

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question