forked from appfog/afdocs
/
.htaccess
30 lines (23 loc) · 848 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
DirectoryIndex index.html index.xml
# Redirect old URLs
Options +FollowSymlinks
RewriteEngine On
DirectorySlash Off
# Append trailing slash to directories
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^_site/(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
# Remove .html extension
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /.+\.html\ HTTP
RewriteRule ^_site/(.+)\.html$ http://%{HTTP_HOST}/$1 [R=301,L]
# add .html file extension (if such file does exist)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^.+$ %{REQUEST_FILENAME}.html [L]
<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif)$">
Header set Cache-Control "max-age=864000, public"
Header unset Last-Modified
</FilesMatch>
<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200"
</FilesMatch>