Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I need to redirect the following instances to;

I have the following in my .htaccess already, but this only redirects to;

<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
  RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Grateful if anyone could perhaps tell me what I need to add. Thank you.

share|improve this question

migrated from Nov 12 '11 at 8:59

This question came from our site for professional and enthusiast programmers.

Perfect. Thank you. :D – Arpanet Sep 26 '11 at 21:28
up vote 1 down vote accepted

Remove the second RewriteCond so you filter ONLY on the https status, and not anything to do with the requested host. That'll make it an unconditional redirect, regardless of how the site was requested

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.