Skip to content

Commit

Permalink
Update example regarding forcing https://
Browse files Browse the repository at this point in the history
* Improve example by removing the need to edit the domain name.
* Move example under the `URL Rewrites` section.

Ref: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
  • Loading branch information
alrra committed Sep 26, 2014
1 parent 9563bbe commit 060b70c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### HEAD

* Update example regarding forcing `https://`.

### 2.8.0 (September 13, 2014)

* Improve configs for `.rdf` files
Expand Down
25 changes: 12 additions & 13 deletions dist/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,18 @@ AddDefaultCharset utf-8

</IfModule>

# ------------------------------------------------------------------------------
# | Force `https://` |
# ------------------------------------------------------------------------------

# Redirect from the `http://` to the `https://` version of the URL.
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS

# <IfModule mod_rewrite.c>
# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# </IfModule>

# ------------------------------------------------------------------------------
# | Suppressing / Forcing the `www.` at the beginning of URLs |
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -539,19 +551,6 @@ AddDefaultCharset utf-8
# </FilesMatch>
# </IfModule>

# ------------------------------------------------------------------------------
# | Secure Sockets Layer (SSL) |
# ------------------------------------------------------------------------------

# Rewrite secure requests properly in order to prevent SSL certificate warnings.
# E.g.: prevent `https://www.example.com` when your certificate only allows
# `https://secure.example.com`.

# <IfModule mod_rewrite.c>
# RewriteCond %{SERVER_PORT} !^443
# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
# </IfModule>

# ------------------------------------------------------------------------------
# | HTTP Strict Transport Security (HSTS) |
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 060b70c

Please sign in to comment.