Answer the question
In order to leave comments, you need to log in
How to write a redirect without duplicating a page?
Hello, there is a page on the site:
site.com/page1 - you need:
1. For this page to be displayed as a root page,
2. So that when I type site.com/page1 in the browser, there is a 301 redirect to the root page (well, it is also displayed )
the first redirect works fine:
RewriteRule ^$ page1 [L]
If you write after that:
RewriteRule ^page1$ / [R=301,L]
Then an error occurs.
Answer the question
In order to leave comments, you need to log in
the first redirect works fine:
RewriteRule ^$ page1 [L]
If you write after that:
RewriteRule ^page1$ / [R=301,L]
# с главной на /page22222
RewriteRule ^$ page22222 [R=301,L]
# с /page11111 на главную
RewriteRule ^page11111$ / [R=301,L]
RewriteRule ^/$ page22222 [R=301,L]
RewriteRule ^/page11111$ / [R=301,L]
RewriteRule ^/page11111$ page22222 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question