mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
consolidate mod_rewrite rules, comment out ssl redirect for now
This commit is contained in:
parent
83de01fa3f
commit
448ebbc64b
@ -278,7 +278,7 @@ AddDefaultCharset utf-8
|
||||
# Options +SymLinksIfOwnerMatch
|
||||
|
||||
# (4)
|
||||
# RewriteBase /
|
||||
RewriteBase /
|
||||
|
||||
# (5)
|
||||
# RewriteOptions <options>
|
||||
@ -306,11 +306,11 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Option 1: rewrite www.example.com → example.com
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
|
||||
</IfModule>
|
||||
# <IfModule mod_rewrite.c>
|
||||
# RewriteCond %{HTTPS} !=on
|
||||
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
# RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
|
||||
# </IfModule>
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@ -532,10 +532,10 @@ AddDefaultCharset utf-8
|
||||
# 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://kremalicious.com%{REQUEST_URI} [R=301,L]
|
||||
</IfModule>
|
||||
# <IfModule mod_rewrite.c>
|
||||
# RewriteCond %{HTTPS} !=on
|
||||
# RewriteRule ^(.*)$ https://kremalicious.com/$1 [R=301,L]
|
||||
# </IfModule>
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | HTTP Strict Transport Security (HSTS) |
|
||||
@ -784,15 +784,17 @@ FileETag None
|
||||
# Rewrite post urls
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteBase /
|
||||
|
||||
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
RewriteRule ^ http://%1%{REQUEST_URI} [R]
|
||||
|
||||
# redirect all index.html to parent folder
|
||||
RewriteCond %{REQUEST_URI} ^(.*/)index\.html$ [NC]
|
||||
RewriteRule . %1 [R=301,NE,L]
|
||||
|
||||
# redirect to leading trailing slash
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_URI} !(.*)/$
|
||||
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
|
||||
|
||||
# RewriteCond %{HTTPS} !=on
|
||||
# RewriteRule ^(.*)$ https://kremalicious.com/$1 [R=301,L]
|
||||
|
||||
</IfModule>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user