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
|
# Options +SymLinksIfOwnerMatch
|
||||||
|
|
||||||
# (4)
|
# (4)
|
||||||
# RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
# (5)
|
# (5)
|
||||||
# RewriteOptions <options>
|
# RewriteOptions <options>
|
||||||
@ -306,11 +306,11 @@ AddDefaultCharset utf-8
|
|||||||
|
|
||||||
# Option 1: rewrite www.example.com → example.com
|
# Option 1: rewrite www.example.com → example.com
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
# <IfModule mod_rewrite.c>
|
||||||
RewriteCond %{HTTPS} !=on
|
# RewriteCond %{HTTPS} !=on
|
||||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||||
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
|
# RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
|
||||||
</IfModule>
|
# </IfModule>
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
@ -532,10 +532,10 @@ AddDefaultCharset utf-8
|
|||||||
# E.g.: prevent `https://www.example.com` when your certificate only allows
|
# E.g.: prevent `https://www.example.com` when your certificate only allows
|
||||||
# `https://secure.example.com`.
|
# `https://secure.example.com`.
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
# <IfModule mod_rewrite.c>
|
||||||
RewriteCond %{SERVER_PORT} !^443
|
# RewriteCond %{HTTPS} !=on
|
||||||
RewriteRule ^ https://kremalicious.com%{REQUEST_URI} [R=301,L]
|
# RewriteRule ^(.*)$ https://kremalicious.com/$1 [R=301,L]
|
||||||
</IfModule>
|
# </IfModule>
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# | HTTP Strict Transport Security (HSTS) |
|
# | HTTP Strict Transport Security (HSTS) |
|
||||||
@ -784,15 +784,17 @@ FileETag None
|
|||||||
# Rewrite post urls
|
# Rewrite post urls
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
|
RewriteCond %{HTTPS} !=on
|
||||||
|
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||||
|
RewriteRule ^ http://%1%{REQUEST_URI} [R]
|
||||||
|
|
||||||
# redirect all index.html to parent folder
|
# redirect all index.html to parent folder
|
||||||
RewriteCond %{REQUEST_URI} ^(.*/)index\.html$ [NC]
|
RewriteCond %{REQUEST_URI} ^(.*/)index\.html$ [NC]
|
||||||
RewriteRule . %1 [R=301,NE,L]
|
RewriteRule . %1 [R=301,NE,L]
|
||||||
|
|
||||||
# redirect to leading trailing slash
|
# RewriteCond %{HTTPS} !=on
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
# RewriteRule ^(.*)$ https://kremalicious.com/$1 [R=301,L]
|
||||||
RewriteCond %{REQUEST_URI} !(.*)/$
|
|
||||||
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
|
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user