Answer the question
In order to leave comments, you need to log in
How to make such a redirect using htaccess?
Good day to everyone, help me solve this problem.
When setting the URLs on the site, an error was made: for example site.com/catalog/prodAct, but it was necessary to prodUct because
the site was indexed, I want to make 301 from the wrong URLs to the correct ones, the problem is that I not strong in the .htaccess syntax and after the product may or may not be the remaining parts of the path, those urls may look like this:
site.com/catalog/product
site.com/catalog/product/apple
site.com/catalog/product/apple /iphone
site.com/catalog/product/htc
site.com/catalog/product?search
and so on, there can be many variations.
How can I "bite" out of the middle of the prodAct url, change it to prodUct ? The parts to the left and right of the product are the same, it was a syntax error that was made, not a change in the url format Thanks
in advance to everyone who helps
Answer the question
In order to leave comments, you need to log in
RewriteRule ^(.*?)prodact(.*?) $1product$2 [R=301]
something like this, maybe someone will write a better version)
RewriteRule ^catalog/prodact(.*?) /catalog/product$1 [R=301]
// well, another option)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question