forked from eberkund/seniorchairs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
executable file
·42 lines (34 loc) · 1.25 KB
/
.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
31
32
33
34
35
36
37
38
39
40
41
42
RewriteEngine On
RewriteBase /
Options +FollowSymLinks
# Remove index.html from directories
RewriteRule ^(.*)index.html$ $1 [R=301,NC,L]
# Force www subdomain
RewriteCond %{HTTP_HOST} ^[^www].*$ [NC]
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force no subdomain
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Remove query parameters
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^(.*)$ /$1? [G,L]
# Enable compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript image/svg+xml
# Add proper MIME-type for favicon
AddType image/x-icon .ico
# Enable browser caching
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
# Error pages
ErrorDocument 404 /404/
ErrorDocument 403 /403/
ErrorDocument 500 /500/