Created
January 21, 2014 12:05
-
-
Save opnchaudhary/8538822 to your computer and use it in GitHub Desktop.
Apache configuration to force all HTTP to HTTPS request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#File: /etc/httpd/conf.d/https_redirection.conf | |
#Force all HTTP request to HTTPS request | |
<IfModule !mod_rewrite.c> | |
LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
ReWriteCond %{SERVER_PORT} !^443$ | |
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | |
</IfModule> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment