Answer the question
In order to leave comments, you need to log in
How to exclude pages from a redirect?
Good afternoon! you need to set up a redirect for all pages of the old site (site-old.ru) to a new page of the new site (site.ru/page1/). There were no problems with everything set up
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site-old.ru$ [OR]
RewriteCond %{HTTP_HOST} ^www.site-old.ru$
RewriteRule ^(.*)$ http://site.ru/page1/ [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site-old.ru$ [OR]
RewriteCond %{HTTP_HOST} ^www.site-old.ru$
RewriteCond %{REQUEST_URI} ^!kontaktyi/$
RewriteRule ^(.*)$ http://site.ru/page1/ [L,R=301]
Answer the question
In order to leave comments, you need to log in
Kind.
Try this
You will probably also need file exclusions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/index.php$
RewriteCond %{REQUEST_URI} !^/en$
RewriteCond %{REQUEST_URI} !^/en/$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://site.com/$1 [L,R=301]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question