Introduction
Due to inheritance of rewrite rules, you may find that rewrites are applying to domains you did not intend. In this case you can add an exclude for the domain.
Procedure
You can exclude the domain be adding an additional RewriteCond line like the following above the RewriteRule line. In this example, we are excluding the "domain.tld" domain. Note that the periods are escaped with a backslash to keep other domains from possibly being matched.
RewriteCond %{HTTP_HOST} !^domain\.tld$
For example, if your rewrite rule looks like that following before adding the exclude:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
It would look like that following after adding the exclude.
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^domain\.tld$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Comments
0 comments
Article is closed for comments.