-
Notifications
You must be signed in to change notification settings - Fork 13
/
SAMPLE.htaccess
59 lines (48 loc) · 1.92 KB
/
SAMPLE.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
<IfModule mod_rewrite.c>
#Rewrite Engine Settings : Warning, AllowOverride need to be all for current folder
RewriteEngine On
RewriteBase /
#If the URL start with public stop redirect
RewriteRule ^cache - [L]
RewriteRule ^index.php - [L]
#If file already exists
RewriteCond %{DOCUMENT_ROOT}/cache%{REQUEST_URI} -f
RewriteRule ^(.*)$ cache/$1 [L]
#Else go to controller
RewriteRule ^(|(.*)\/)([0-9]+x[0-9]+|[a-z]+[0-9]+|original)\/(.*)$ index.php?path=$4&format=$3&scheme=$2 [L,QSA]
</IfModule>
########################### MOD_DEFLATE COMPRESSION ############################
#Do not put in cache if files are already in
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
################################ EXPIRE HEADERS ################################
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "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"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
</IfModule>
############################ CACHE CONTROL HEADERS #############################
<IfModule mod_headers.c>
#les proxies doivent donner le bon contenu
Header append Vary User-Agent env=!dont-vary
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
# KILL THEM ETAGS
Header unset ETag
FileETag none
</IfModule>
############################ PROTECT HTACCESS FILE #############################
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
############################ PROTECT FOLDER LISTING ############################
Options -Indexes