.htaccess RewriteCond for a specific page
.htaccess, mod-rewrite
Solution
Add extra conditions to your redirect rule:
RewriteCond %{REQUEST_URI} !/this-page\.html
RewriteCond %{REQUEST_URI} !/this-page2\.html
RewriteCond %{HTTP_HOST} ^www\.additional-domain\.com [NC]
RewriteRule (.*) http://www.main-domain.com$1 [R=301,L]
Problem
I currently have a website on one domain and it has another domain mapped to it. I have a .htaccess RewriteCond like the following: ``` RewriteCond %{HTTP_HOST} ^www\.additional-domain\.com [NC] RewriteRule (.*) http://www.main-domain.com$1 [R=301,L] ``` This obviously means that any pages accessed by going to www.additional-domain.com will redirect to the correct page on www.main-domain.com. What I would like to know is; can I keep this rule but have certain pages not redirect? so for page /this-page.html if the user accessed www.additional-domain.com/this-page.html then they are not redirected to www.main-domain.co.uk/this-page.html Is this even possible? Thanks. -------- EDIT -------- I neglected to mention that for those additional pages I want the redirect to work in reverse. So if someone accessed www.main-domain.co.uk/this-page.html then they would be redirected to www.additional-domain.co.uk/this-page.html