forked from GilaCMS/gila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
executable file
·39 lines (31 loc) · 1.04 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
# 3 MONTHS - unlikely to be changed
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|jpg|jpeg|png|gif|webp)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|jpg|png|gif)$
</IfModule>
RewriteEngine On
# exclude these folders
RewriteCond %{REQUEST_URI} !/vendor/
RewriteCond %{REQUEST_URI} !/src/
RewriteCond %{REQUEST_URI} !/themes/
RewriteCond %{REQUEST_URI} !/lib/
RewriteCond %{REQUEST_URI} !/assets/
RewriteCond %{REQUEST_URI} !/tmp/
RewriteCond %{REQUEST_URI} !robots.txt
# dont list folder contents
IndexIgnore *
RewriteRule (.*)$ index.php?url=$1 [QSA,L]
# enforce https redirection
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# redirect all sites
# RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
# RewriteCond %{HTTP_HOST} !^localhost$ [NC]
# RewriteRule ^assets/(.*)$ sites/%{HTTP_HOST}/assets/$1 [NC]
# RewriteRule ^tmp/(.*)$ sites/%{HTTP_HOST}/tmp/$1 [NC]