Skip to content

Instantly share code, notes, and snippets.

@KINKCreative
Created September 24, 2018 10:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KINKCreative/7d2d4310507b9eab7251dfeecbca44f3 to your computer and use it in GitHub Desktop.
Save KINKCreative/7d2d4310507b9eab7251dfeecbca44f3 to your computer and use it in GitHub Desktop.
Apache Redirect to www and https
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
RewriteCond %{HTTP_HOST} ^domain\.org$
RewriteRule (.*)$ https://www.domain.org$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment