Jump to content

Forcing https://


jacmaes
 Share

Recommended Posts

Now that CloudFlare has free Universal SSL, I'd like to serve my site over https://

What is the recommended PW approach to do this? Is it just a matter of tweaking the .htaccess file to force https:// ? If so, how would I go about it?

With one little tweak -- adding an "s" to the force "www." rewrite rule -- I can successfully redirect from http://domain.com to https://www.domain.com:

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

But how should I deal with the second scenario: redirecting from http://www.domain.com to http s://www.domain.com? Everything I've tried ends up in a redirect loop. 

 
Link to comment
Share on other sites

  • 4 months later...

If you are using CloudFlare, all you need to do is change your CloudFlare config. You don't get true end-to-end https that way, just between the browser & CloudFlare - not between CloudFlare & your site.

My blog (see sig) does it that way (and you get SPDY as an added bonus).

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...