Answer the question
In order to leave comments, you need to log in
How to set up an exception for a redirect from a domain to a subdomain?
I use a redirect on the site from a domain to a subdomain:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]
RewriteRule (.*) https://1.domain.com/$1 [R=302,L]
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{REQUEST_URI} !^/sitemap\.xml$
RewriteRule (.*) https://1.domain.com/$1 [R=302,L]
RewriteEngine On
RewriteRule ^(robots\.txt|sitemap\.xml)$ - [L]
RewriteRule (.*) https://1.domain.com/$1 [R=302,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question