Geronantimo
Technical User
I have an existing website that will now be moved to a subdomain. I would like to use rewrite rules to redirect all of the requested pages to the subdomain apart from the index.html and requests that come to the website using just the domain name (without index,html)
I have got as far as writing the condition to rewrite to the subdomain:
However, I am have been unable to add the condition that excludes the index.html. This does not seem to work:
But this isn't the only problem; I don't know how to exclude requests that come to (with just the slash)
Could somebody please give me some suggestions?
I have got as far as writing the condition to rewrite to the subdomain:
Code:
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^[URL unfurl="true"]www.domain.com$[/URL]
RewriteRule ^(.*)$ [URL unfurl="true"]http://sub.domain.com/$1[/URL] [R=301,L]
However, I am have been unable to add the condition that excludes the index.html. This does not seem to work:
Code:
rewriteCond %{REQUEST_URI} !^index.html
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^[URL unfurl="true"]www.domain.com$[/URL]
RewriteRule ^(.*)$ [URL unfurl="true"]http://sub.domain.com/$1[/URL] [R=301,L]
But this isn't the only problem; I don't know how to exclude requests that come to (with just the slash)
Could somebody please give me some suggestions?