forked from forkcms/forkcms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
86 lines (72 loc) · 2.9 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
# follow symlinks & disallow directory listing
# note: your hosting company might not allow these directives to be set. In that case,
# you should either find another hosting company (advised) or remove the line below.
Options +FollowSymlinks -Indexes
# file etags (used when comparing local cached file to server file)
FileETag MTime Size
<IfModule mod_rewrite.c>
# nice urls
RewriteEngine On
RewriteBase /
# forbidden folders
RewriteRule .*\.gitignore - [F]
RewriteRule frontend/cache/cached_templates - [F]
RewriteRule frontend/cache/compiled_templates - [F]
RewriteRule frontend/cache/config - [F]
RewriteRule frontend/cache/locale/.*\.php - [F]
RewriteRule frontend/cache/logs - [F]
RewriteRule frontend/cache/navigation/.*\.php - [F]
RewriteRule frontend/cache/search - [F]
RewriteRule backend/cache/compiled_templates - [F]
RewriteRule backend/cache/config - [F]
RewriteRule backend/cache/cronjobs - [F]
RewriteRule backend/cache/locale/.*\.php - [F]
RewriteRule backend/cache/logs - [F]
RewriteRule backend/cache/navigation - [F]
# one url to rule them all
# RewriteCond %{HTTP_HOST} !^www\.<domain>\.be [NC]
# RewriteCond %{HTTP_HOST} !.*\.dev [NC]
# RewriteRule ^(.*)$ http://www.<domain>.be/$1 [R=301,L]
# backend is an existing folder, but it should be handled as all urls
RewriteCond %{REQUEST_URI} ^/backend/$
RewriteRule . index.php [NC,L]
# handle urls
RewriteCond %{REQUEST_URI} !^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L]
# set environment variable to let PHP know that urls are being rewritten
RewriteRule .* - [E=MOD_REWRITE:1]
</IfModule>
# file caching in browser
<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(ico|gif|jpe?g|png|svg|svgz|js|css|swf|ttf|otf|woff|eot)$">
ExpiresDefault "access plus 1 month"
</FilesMatch>
</IfModule>
# gzip on Apache 2
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml text/javascript text/css application/x-javascript application/xhtml+xml application/javascript
# these browsers do not support deflate
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force
</IfModule>
# gzip on Apache 1
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_item_include mime ^application/javascript$
mod_gzip_item_include mime ^application/x-javascript$
mod_gzip_item_include mime ^application/xhtml+xml$
mod_gzip_item_include mime ^application/xml$
mod_gzip_item_include mime ^text/css$
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/javascript$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^text/xml$
mod_gzip_item_exclude mime ^image/
# browser issues
mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
</IfModule>