-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
120 lines (83 loc) · 4.41 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
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
# ---------------------------------------------------------------------------------------------------- Divers
AddDefaultCharset UTF-8
RewriteEngine on
Options -Indexes
# ---------------------------------------------------------------------------------------------------- Vérifie la présence du "www"
#RewriteCond %{http_host} ^site.com [nc]
#RewriteRule ^(.*)$ https://www.site.com/$1 [r=301,nc]
# ---------------------------------------------------------------------------------------------------- Redirection vers HTTPS
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# ---------------------------------------------------------------------------------------------------- Si ni fichier ni dossier...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ---------------------------------------------------------------------------------------------------- Authentification PHP
#<IfModule mod_rewrite.c>
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>
# ---------------------------------------------------------------------------------------------------- Config PHP
<IfModule mod_php5.c>
php_value upload_max_filesize 1000M
php_value post_max_size 2000M
php_value memory_limit 3000M
php_value max_execution_time 180
php_value max_input_time 180
</IfModule>
# ---------------------------------------------------------------------------------------------------- Pages
RewriteRule ^preview.htm$ preview.php [QSA,L]
RewriteRule ^documentation.htm$ doc.php [QSA,L]
RewriteRule ^minimalist.htm$ minimalist.php [QSA,L]
# ---------------------------------------------------------------------------------------------------- Redirection des pages d'erreurs
RewriteRule ^err(o|eu)r$ erreur.php [QSA,L]
RewriteRule ^err(o|eu)r-([0-9]{3})$ erreur.php?n=$2 [QSA,L]
ErrorDocument 400 /erreur-400
ErrorDocument 401 /erreur-401
ErrorDocument 403 /erreur-403
ErrorDocument 404 /erreur-404
ErrorDocument 406 /erreur-406
ErrorDocument 408 /erreur-408
ErrorDocument 500 /erreur-500
# ---------------------------------------------------------------------------------------------------- EXPIRES
<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"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# ---------------------------------------------------------------------------------------------------- DEFLATE
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:pdf|avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent env=!dont-vary
</IfModule>