-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
66 lines (58 loc) · 2.46 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
AddDefaultCharset UTF-8
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
ServerSignature Off
<FilesMatch ".(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<ifModule mod_headers.c>
Header unset ETag
Header unset Last-Modified
# html и files for a one day
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=43200, public"
</FilesMatch>
# css, javascript и planetext-files for a one week
<FilesMatch "\.(js|css|txt)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# flash for a month
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
# disable cache for service files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
<ifModule mod_expires.c>
ExpiresActive On
# by default cache is 5 seconds
ExpiresDefault "access plus 5 seconds"
# cache flash and images for a month
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
# cache css, javascript and planetext-files for a week
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
# cache html and htm for a one day
ExpiresByType text/html "access plus 43200 seconds"
# cache xml for a ten minutes
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript application/x-font-ttf application/vnd.ms-fontobject font/opentype font/ttf font/eot font/otf
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC]
RewriteRule ^(.*)$ http://site.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/].*)?$ /app/frontend/web/$1 [L]
</IfModule>