Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As the question states, I want to redirect http://example to AND to

I tried the apache re-write rules:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#jmv-this should work, but does not
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

but only gets redirected to When I go to I stay at

I think these rules should work. What's the problem?

share|improve this question
Where are those rules configured? – Shane Madden Sep 14 '11 at 19:23
.htaccess file. It is the standard .htaccess that comes with a drupal install. – jmvidal Sep 14 '11 at 19:26
Is there anything substantively different about the :443 VirtualHost block from the port 80 one? Specifically, an AllowOverride? – Shane Madden Sep 14 '11 at 19:33
Ahhh, that was it! Put it in an answer and I'll mark it. Thanks! – jmvidal Sep 14 '11 at 19:43
up vote 1 down vote accepted

AllowOverride elsewhere in the configuration can inadvertently disable the use of .htaccess files - which seems to have been the case here!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.