Answer the question
In order to leave comments, you need to log in
How to formulate .htaccess 301 redirect (string insertion in URL)?
Woo Commerce for WP uses a specific rewrite base in its URLs
For
example:
www.mysite.com/shop/product_cat/product_subcat/product
The Woo website explains that shop cannot be removed, as it can cause serious conflicts.
I need to migrate a site that keeps the results in the index, so I want to set up a 301 redirect in htacess like this:
All requests, except for a certain list (information pages, there are a limited number of them), redirect to identical requests, with an insert /shop/
The question is how to formulate a rule for .htaccess so that
www.mysite.com/product_cat/product_subcat/product
www.mysite.com /shop/ product_cat/product_subcat/product
/product_subcat is an optional part, it may or may not be in the link .
Answer the question
In order to leave comments, you need to log in
RewriteEngine on
RedirectMatch 301 /product_cat/(.*) /shop/product_cat/$1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question