Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.sub.domain.com$
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
RewriteCond %{HTTP_HOST} ^sub.domain.com$
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
RewriteCond %{SERVER_PORT}!443$
RewriteRule ^(.*)$ [domain.com...] [R]
Here are my goals:
1) redirect all requests of www.sub.domain.com to www.domain.com/sub/
2) redirect all requests of sub.domain.com to www.domain.com/sub/
3) redirect all requests of domain.com to www.domain.com/sub/
4) Have all redirects redirecting to HTTPS
My problem:
when i try to access "http://sub.domain.com/file.html" it will redirect to "https://domain.com/sub/file.html" rather than "https://www.domain.com/sub/file.html"
[edited by: PiisAI at 10:46 am (utc) on Aug. 26, 2006]
Jim