I'm trying to make it so that ALL pages are served over SSL and have a https:// prefix.

I'm using the latest Drupal (as of 16.2.15) and running Apache (Fast CGI)

I'd really like it so that if a visitor were to type in:


they's end up at:


With the https added in automatically.

As per this question: How to simply make the whole site HTTPS?

I've added this at the very end of the D7 .htaccess in the root of the domain:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This is not surrounded by any exceptions.

This seems to enforce SSL, but all pages with http:// get redirected to /index.php

So if I got to:


I end up at:




as I'd hoped!

Thanks for any help!

  • 3
    Put that as your first rule, not last – Clive Feb 16 '15 at 14:54
  • Genius - that appears to do the trick! Thanks so much! How do I credit you as the correct answer? – njwrigley Feb 16 '15 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.