-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.htaccess
executable file
·41 lines (32 loc) · 1.06 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
# 3 MONTHS - unlikely to be changed
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|woff2|jpg|jpeg|png|gif|webp|webm)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|json|xml|txt)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
RewriteEngine On
# redirect www to no-www
# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# enforce https redirection
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# exclude these folders
RewriteCond %{REQUEST_URI} !/assets/
RewriteCond %{REQUEST_URI} !/tmp/
RewriteCond %{REQUEST_URI} !robots.txt
# dont list folder contents
IndexIgnore *
RewriteRule (.*)$ index.php?p=$1 [QSA,L]
# redirect subdomains
# RewriteEngine On
# RewriteCond %{REQUEST_URI} !/sites/
# RewriteCond %{HTTP_HOST} !^example\.com
# RewriteRule ^assets/uploads/(.*)$ sites/%{HTTP_HOST}/assets/uploads/$1 [NC]
# RewriteCond %{HTTP_HOST} !^example\.com
# RewriteRule ^tmp/(.*)$ sites/%{HTTP_HOST}/tmp/$1 [NC]