-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
executable file
·69 lines (53 loc) · 1.82 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
# Disallow Apache file index module
Options -Indexes
# Increase Cache Expires
<IfModule mod_expires.c>
<FilesMatch "\.(jpe?g|png|gif|js|css|ico|svg)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</FilesMatch>
</IfModule>
# Add Vary header
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
# Dispatcher
<IfModule mod_rewrite.c>
# Start rewrite engine
RewriteEngine On
# Set flag that rewrite is enabled
SetEnv REWRITE_ENABLED 1
# Set proper URI base
# RewriteBase /
# Redirect associatives for scripts
RewriteCond %{REQUEST_URI} /associatives.js?.*$ [OR]
RewriteCond %{REQUEST_URI} /dependencies.js?.*$ [OR]
RewriteCond %{REQUEST_URI} /bridge.js?.*$
RewriteRule ^.*$ index.php?mode=associatives&at=js [QSA,NC,L]
# Redirect associatives for styles
RewriteCond %{REQUEST_URI} /associatives.css?.*$ [OR]
RewriteCond %{REQUEST_URI} /dependencies.css?.*$ [OR]
RewriteCond %{REQUEST_URI} /bridge.css?.*$
RewriteRule ^.*$ index.php?mode=associatives&at=css [QSA,NC,L]
# Redirect ajax requests
RewriteCond %{REQUEST_URI} /ajax$
RewriteRule ^.*$ index.php?mode=ajax [QSA,NC,L]
# Redirect favicon to index
RewriteCond %{REQUEST_URI} ^\/favicon\.ico.*$
RewriteRule ^.*$ index.php [NC,L]
RewriteRule ^.*$ - [NC]
# Redirect files without file-types, which aren't directories,
# or symbolic links or executables to index
RewriteCond %{REQUEST_URI} /[^\.]*$
RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-l
RewriteCond %{REQUEST_URI} !-x
RewriteRule ^.*$ index.php [NC,L]
RewriteRule ^.*$ - [NC,L]
</IfModule>
<IfModule !mod_rewrite.c>
# Set flag that rewrite is disabled
SetEnv REWRITE_ENABLED 0
</IfModule>