Jump to content

Default HTTPS


Pic0o

Recommended Posts

If anyone ever asks, you can force HTTPS for any http links by editing your .htaccess files for said domains.

I just turned this on today, as I was prior pointing the configurations to use https.  If you run into any snags with the http rewrite rule, drop me a line and let me know.
 

Quote

RewriteEngine On


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


is what I have in the .htaccess for handling the HTTPS defaulting.

The [L] flag is short for Last and the [R] is for Redirection.  Per the Apache docs, the Last says the redirect is only applicable to the current url, as to not break sequential links.
The 301 is saying this is a permanent redirect, in web server language.  It's pretty funny that searching for my nickname, only shows FTB at the bottom of the 1st page on a google search.

Link to comment
×
×
  • Create New...