@@ -300,6 +300,18 @@ AddDefaultCharset utf-8
300
300
301
301
</IfModule >
302
302
303
+ # ------------------------------------------------------------------------------
304
+ # | Force `https://` |
305
+ # ------------------------------------------------------------------------------
306
+
307
+ # Redirect from the `http://` to the `https://` version of the URL.
308
+ # https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
309
+
310
+ # <IfModule mod_rewrite.c>
311
+ # RewriteCond %{HTTPS} !=on
312
+ # RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
313
+ # </IfModule>
314
+
303
315
# ------------------------------------------------------------------------------
304
316
# | Suppressing / Forcing the `www.` at the beginning of URLs |
305
317
# ------------------------------------------------------------------------------
@@ -539,19 +551,6 @@ AddDefaultCharset utf-8
539
551
# </FilesMatch>
540
552
# </IfModule>
541
553
542
- # ------------------------------------------------------------------------------
543
- # | Secure Sockets Layer (SSL) |
544
- # ------------------------------------------------------------------------------
545
-
546
- # Rewrite secure requests properly in order to prevent SSL certificate warnings.
547
- # E.g.: prevent `https://www.example.com` when your certificate only allows
548
- # `https://secure.example.com`.
549
-
550
- # <IfModule mod_rewrite.c>
551
- # RewriteCond %{SERVER_PORT} !^443
552
- # RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
553
- # </IfModule>
554
-
555
554
# ------------------------------------------------------------------------------
556
555
# | HTTP Strict Transport Security (HSTS) |
557
556
# ------------------------------------------------------------------------------
0 commit comments