29 lines
983 B
ApacheConf
29 lines
983 B
ApacheConf
Options -MultiViews -Indexes
|
|
DirectoryIndex index.html
|
|
DirectorySlash Off
|
|
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
|
|
# Old /html/... addresses
|
|
RewriteRule ^html/services/([^/]+)/?(?:index\.html)?$ /services/$1 [R=301,L]
|
|
RewriteRule ^html/(about|giveaway)/?(?:index\.html)?$ /$1 [R=301,L]
|
|
|
|
# /index.html -> /
|
|
RewriteCond %{THE_REQUEST} \s/+index\.html[\s?] [NC]
|
|
RewriteRule ^index\.html$ / [R=301,L]
|
|
|
|
# /services/name/index.html, /about/index.html, /giveaway/index.html -> clean path
|
|
RewriteCond %{THE_REQUEST} \s/+(services/[^/\s]+|about|giveaway)/index\.html[\s?] [NC]
|
|
RewriteRule ^ /%1 [R=301,L]
|
|
|
|
# Drop the trailing slash on those same pages
|
|
RewriteCond %{THE_REQUEST} \s/+(services/[^/\s]+|about|giveaway)/[\s?] [NC]
|
|
RewriteRule ^ /%1 [R=301,L]
|
|
|
|
# Serve the folder's index.html while keeping the clean address
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME}/index.html -f
|
|
RewriteRule ^(.+?)/?$ $1/index.html [L]
|
|
</IfModule>
|