Skip to content

Instantly share code, notes, and snippets.

@jpf
Created June 2, 2009 23:30
Show Gist options
  • Select an option

  • Save jpf/122678 to your computer and use it in GitHub Desktop.

Select an option

Save jpf/122678 to your computer and use it in GitHub Desktop.
# How to redirect HTTP to HTTP and HTTPS to HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ http://www.DOMAIN.com/$1 [R=302,L]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ https://www.DOMAIN.com/$1 [R=302,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment