Answer the question
In order to leave comments, you need to log in
Regular expression to wrap from URL with certain characters to home page?
Need help with creating a regular expression for redirects from links like
sitename.ru/shop_fid_%numbers%/
sitename.ru/shop_fid_%numbers%_pn_%number%.html
sitename.ru/shop_id_%numbers%.html
sitename.ru/pn=% digit%
on sitename.ru
full .htaccess (just in case)
Answer the question
In order to leave comments, you need to log in
This is a very strict redirect that falls right under the template and nothing else, and also with the 301 code, which means the page has moved to a new address
RewriteRule ^shop_f?id_[0-9]+(_pn_[0-9])?(\.html)?/?$ / [R=301,L]
RewriteRule ^pn=[0-9]+$ / [R=301,L]
RewriteRule ^(shop_f?id|pn).*$ / [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question