-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.htaccess
58 lines (50 loc) · 2.27 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
Options -Indexes
RewriteEngine On
# In case it's necessary to allow direct access to all files besides those with extensions listed bellow, uncomment the next two lines
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# Allow direct access to datahub documents
RewriteCond %{REQUEST_URI} !^/datahub
# Allow direct access to files with certain extensions, redirect everything else to index.php
RewriteRule !\.(txt|xml|ico|svg|gif|png|jpg|exe|7z|zip|css|js|gz)$ index.php [L]
# Use .phtml files as .php files
AddType application/x-httpd-php .php .phtml
# Compress HTML, CSS, JavaScript, Text, XML a fonts
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
</IfModule>
# Cache for one week (HTTP/1.0)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/svg+xml "access plus 604800 seconds"
</IfModule>
# Cache for one week (HTTP/1.1)
<IfModule mod_headers.c>
<filesMatch ".(css|js|png|gif|ico|svg)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
</IfModule>