Skip to content

Instantly share code, notes, and snippets.

@olliebun
Created July 8, 2014 06:19
Show Gist options
  • Save olliebun/32564a9f2a3bc30d9463 to your computer and use it in GitHub Desktop.
Save olliebun/32564a9f2a3bc30d9463 to your computer and use it in GitHub Desktop.
apache conf to rewrite all HTTP traffic to HTTPS
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.example.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment