Skip to content

Instantly share code, notes, and snippets.

View yzguy's full-sized avatar

Adam Smith yzguy

  • Akamai Technologies
  • Pennsylvania
View GitHub Profile
<VirtualHost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
HTTP to HTTPS redirect in apache, requires mod_ssl and mod_rewrite
Goes in httpd.conf (CentOS, RHEL) or sites-enabled/{site} file