Last active
December 16, 2018 15:23
-
-
Save ewingson/0991a7b8f6700e89b972f5c0a1cdf91d to your computer and use it in GitHub Desktop.
apache2.conf_rewrite_engine_force_nonwww_https_piece_of_code_in_production
This file contains 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
Rewrite Engine On | |
#RewriteCond %{SERVER_PORT} !^8443$ [OR] | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] | |
#removed port from rule | |
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment