-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
53 lines (46 loc) · 2.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
Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# Mise en cache des ressources statiques
<IfModule mod_headers.c>
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'https://cdn.jsdelivr.net' 'https://unpkg.com', 'https://use.fontawesome.com', 'https://cdnjs.cloudflare.com', 'https://code.jquery.com', 'https://kit.fontawesome.com';"
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# JavaScript
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
# Others
ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>
# Compression des ressources
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/atom_xml
AddOutputFilterByType DEFLATE image/svg+xml application/x-font-ttf application/x-font-opentype application/vnd.ms-fontobject
</IfModule>
# Règles de réécriture existantes
RewriteCond %{REQUEST_URI} !^/(index\.php|images|css|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?c=$1&a=$2&p=$3 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/([^/]+):([^/]+)/?$ index.php?c=$1&a=$2&$3=$4 [L,QSA]
RewriteCond %{REQUEST_URI} !^/(index\.php|images|css|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?c=$1&a=$2 [L,QSA]
RewriteCond %{REQUEST_URI} !^/(index\.php|images|css|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?url_name=$1 [L,QSA]