File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616#
1717# (!) NEVER USE BOTH RULES AT THE SAME TIME!
1818
19+ # (1) The two rules assume by default that both HTTP and HTTPS
20+ # environnements are available for redirection.
21+ # If your SSL certificate could not handle one of the domains
22+ # used during redirection, you should turn the condition on.
23+ #
24+ # https://github.com/h5bp/server-configs-apache/issues/52
25+
1926# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2027
2128# Option 1: rewrite www.example.com → example.com
2229
2330<IfModule mod_rewrite.c>
2431 RewriteEngine On
25- RewriteCond %{HTTPS} !=on
32+ # (1)
33+ # RewriteCond %{HTTPS} !=on
2634 RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
2735 RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
2836</IfModule>
3644
3745# <IfModule mod_rewrite.c>
3846# RewriteEngine On
39- # RewriteCond %{HTTPS} !=on
47+ # # (1)
48+ # # RewriteCond %{HTTPS} !=on
4049# RewriteCond %{HTTP_HOST} !^www\. [NC]
4150# RewriteCond %{SERVER_ADDR} !=127.0.0.1
4251# RewriteCond %{SERVER_ADDR} !=::1
You can’t perform that action at this time.
0 commit comments