0

recently I develope a new cms and need to redirect 410 some urls that contains specific word which had been created from my old Cms

some url like the below

https://www.domin.com/category-laptop/filter/minPrice-11000000/maxPrice-293000000/Attributes-41_3862-41_3940-41_3961-/page-2

i need a code for Htaccess that when we have the filter Word in our url, redirect it to 410

for example

https://www.domin.com/category-laptop/filter/minPrice-11000000/maxPrice-293000000

return 410 redirect

or

https://www.domin.com/category-laptop/filter/Attributes-41_3862-41_3940-41_3961-/page-2

return 410 redirect

it doesn't matter where Filter keyword is located

simpely i need a code in htaccess that redirect to 410 When url has the keyword : filter ,but when it does not exist do nothing

i try this code but not work

RewriteCond %{QUERY_STRING} filter RewriteRule .* - [R=410,L]

//i means if isset filter in url Redirect to 410

or

RewriteRule filter\/* [R=410,L]

//i means if isset filter and then everything after that,redirect to 410 or

Redirect gone /*filter

Hamed
  • 1
  • 2
    There is not query string in that URL, so no sense in trying to match "filter" in that. You simply want to match it in the actual requested path, so something like `RewriteRule filter - [R=410,L]` , I'd say ... – arkascha May 29 '23 at 19:41

0 Answers0