-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
71 lines (71 loc) · 3.16 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
67
68
69
70
71
# BEGIN Clementine
AddDefaultCharset UTF-8
RewriteEngine On
# interdit l'accès au contenu du dossier app
RewriteRule ^app/.* index.php [L,NC]
# redirige tout vers l'index : c'est le point d'entree du MVC
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
# pour plus de securite, on redirige aussi l'appel à certains fichiers ou dossiers même s'ils existent vers la 404
RewriteRule ^.*\.svn/.* index.php [L,NC]
RewriteRule ^.*\.git/.* index.php [L,NC]
RewriteRule ^.*\.DS_Store index.php [L,NC]
RewriteRule ^.*\.install_temp/* index.php [L,NC]
RewriteCond %{REQUEST_FILENAME} .gitignore [OR]
RewriteCond %{REQUEST_FILENAME} README.md [OR]
RewriteCond %{REQUEST_FILENAME} \.(ini)$ [NC]
RewriteRule ^(.*)$ index.php [L,NC]
# Utilise la page d'erreur 404 meme pour les URL non reecrites
RewriteCond %{ENV:REDIRECT_STATUS} !=404
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* err404/index [L]
<IfModule mod_headers.c>
Header set X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
</IfModule>
# Forcer l'activation du cache (site en production)
<IfModule mod_expires.c>
<FilesMatch "(?i)^.*\.(ico|flv|swf|jpg|jpeg|png|gif|js|css|svg)$">
ExpiresActive On
ExpiresDefault "access plus 5 minutes"
ExpiresByType image/jpg "access plus 5 minutes"
ExpiresByType image/jpeg "access plus 5 minutes"
ExpiresByType image/png "access plus 5 minutes"
ExpiresByType image/svg+xml "access plus 5 minutes"
ExpiresByType image/gif "access plus 5 minutes"
ExpiresByType image/ico "access plus 5 minutes"
ExpiresByType image/icon "access plus 5 minutes"
ExpiresByType image/x-icon "access plus 5 minutes"
ExpiresByType text/css "access plus 5 minutes"
ExpiresByType text/javascript "access plus 5 minutes"
ExpiresByType text/html "access plus 5 minutes"
ExpiresByType application/xhtml+xml "access plus 5 minutes"
ExpiresByType application/javascript "access plus 5 minutes"
ExpiresByType application/x-javascript "access plus 5 minutes"
ExpiresByType application/x-shockwave-flash "access plus 5 minutes"
<IfModule mod_headers.c>
Header set Cache-Control "public, no-transform"
</IfModule>
</FilesMatch>
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|svg)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
</IfModule>
# Force la desactivation du cache (site en developpement)
#<IfModule mod_headers.c>
# FileETag None
# Header unset ETag
# <IfModule mod_expires.c>
# Header set Expires "Fri, 01 Jan 1970 00:00:00 GMT"
# </IfModule>
# Header set Cache-Control "public, no-transform, no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"
#</IfModule>
# Sous une app cordova version IOS, pour contourner l'erreur "Failed to load a resource: The network connection was lost")
# cf. http://stackoverflow.com/questions/33895463/safari-ajax-request-failed-to-load-resource-the-network-connection-was-lost
#SetEnv nokeepalive
# END Clementine