Answer the question
In order to leave comments, you need to log in
301 redirect not working, what's wrong?
Good evening everyone. I tried to make a redirect from one url address - to the CNC address. Inside the site, the URLs were rewritten in cnc. That is, you need a 301 redirect from one page to another. Since when creating the CNC, the old URLs also remained, and these are duplicate pages that need to be glued together. Editing in htaccess file. But after editing it doesn't work. Where is the mistake?
Need a redirect from a page like https://mirtreiderov.ru/blog/index?BlogPostSearch%...
to a page like https://mirtreiderov.ru/blog/theme/finanasovie-novosti
Answer the question
In order to leave comments, you need to log in
The Redirect directive belongs to mod_alias and there is no way to match the template with GET parameters.
But mod_rewrite has such an opportunity.
RewriteCond %{QUERY_STRING} ^BlogPostSearch(?i:%5B|\[)theme_id(?i:%5D|\])=1$
RewriteRule ^blog/index$ https://mirtreiderov.ru/blog/theme/finanasovie-novosti? [R=301,L]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^blog/index$ https://mirtreiderov.ru/blog [R=301,L]
Redirect 301 /blog/index /blog
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question