-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtaccess_alt
More file actions
125 lines (108 loc) · 3.65 KB
/
htaccess_alt
File metadata and controls
125 lines (108 loc) · 3.65 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# htaccess starter template
# v20121004 htaccessbook.com/changelog
# Enable mod_rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
# Enable symbolic links
Options +FollowSymLinks
# Disable index views
Options All -Indexes
# Specify the default language
DefaultLanguage en
# Specify the default character set
AddDefaultCharset utf-8
# Disable the server signature
ServerSignature Off
# Disable ETags
# FileETag none
# <IfModule mod_headers.c>
# Header unset ETag
# </IfModule>
# Enable basic spell-checking
<IfModule mod_speling.c>
CheckSpelling On
</IfModule>
# Enable file compression
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ \
^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
<IfModule mod_filter.c>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/javascript
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
</IfModule>
<IfModule !mod_filter.c>
AddOutputFilterByType DEFLATE text/css text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/javascript application/javascript
</IfModule>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
Header append Vary Accept-Encoding
</IfModule>
</IfModule>
# Optimize cache-control
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType text/xml "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresByType application/xml "access plus 1 seconds"
ExpiresByType application/rss+xml "access plus 1 seconds"
ExpiresByType application/json "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 application/x-javascript "access plus 1 week"
<IfModule mod_headers.c>
Header unset ETag
Header unset Pragma
Header unset Last-Modified
Header append Cache-Control "public, no-transform, must-revalidate"
</IfModule>
</IfModule>
# Canonical URLs
# uncomment one of the following to enable either technique
# Remove www
#<IfModule mod_rewrite.c>
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#</IfModule>
# Require www
#<IfModule mod_rewrite.c>
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
# RewriteRule ^(.*)$ http://www.%1$1 [R=301,L]
#</IfModule>
# Block hotlink requests
# uncomment to enable and edit the domain name and list of file types
#<IfModule mod_rewrite.c>
# RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com [NC]
# RewriteRule \.(gif|jpe?g?|png)$ - [NC,F,L]
#</IfModule>
# Custom error pages
# uncomment to enable and edit each file path
#ErrorDocument 400 /errors/400.html
#ErrorDocument 401 /errors/401.html
#ErrorDocument 403 /errors/403.html
#ErrorDocument 404 /errors/404.html
#ErrorDocument 500 /errors/500.html