mirror of
https://github.com/kremalicious/blog.git
synced 2025-01-18 16:47:06 +01:00
rewrite rules cleanup
This commit is contained in:
parent
dea68fce56
commit
3ad5cf8c03
@ -656,21 +656,9 @@ FileETag None
|
|||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
|
|
||||||
# redirect any /post-slug.html to /post-slug
|
# redirect all index.html to parent folder
|
||||||
#RewriteCond %{THE_REQUEST} ^[A-Z]+\s([^\s]+)\.html\s
|
RewriteCond %{REQUEST_URI} ^(.*/)index\.html$ [NC]
|
||||||
#RewriteRule .* %1 [R=301,L]
|
RewriteRule . %1 [R=301,NE,L]
|
||||||
|
|
||||||
# Redirects /post-slug.html to /post-slug
|
|
||||||
# from http://stackoverflow.com/a/16773980/733677
|
|
||||||
#
|
|
||||||
# is not directory
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
# is an existing html file
|
|
||||||
RewriteCond %{REQUEST_FILENAME}\.html -f
|
|
||||||
# request URI ends with .html
|
|
||||||
RewriteCond %{REQUEST_URI} ^(.+)\.html$
|
|
||||||
# redirect from file.html to file
|
|
||||||
RewriteRule (.*)\.html$ /$1 [R=301,L]
|
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user