-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.htaccess
103 lines (90 loc) · 4.14 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#Setup error docs
#ErrorDocument 401 test.php?error=401
#ErrorDocument 403 test.php?error=403
#ErrorDocument 404 test.php?error=404
#ErrorDocument 500 test.php?error=500
# Make sure required options are on
Options +FollowSymlinks
RewriteEngine on
# Make sure there's no way of getting to this file
<FilesMatch "\.htaccess$">
Order deny,allow
Deny from all
Satisfy all
</FilesMatch>
<FilesMatch ".*\.private\.[A-Za-z]+$">
Order Deny,Allow
Deny from all
</FilesMatch>
# Set user agent environment variables
SetEnvIfNoCase User-Agent (Opera|Chrome|Version|Firefox|MSIE)[\/|\s](\d+)\. browser=$1 version=$2
SetEnvIf browser Version browser=Safari
SetEnvIf browser MSIE browser=IE
# Pass html requests through to generate page
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*ajax/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*data/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*render/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*stats/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*api/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*javascript/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^(.*)$ index.php?panel=$1&%{QUERY_STRING} [L]
# Pass ajax requests through the data portal
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*render/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*stats/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*api/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*javascript/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^data/(.*)$ data.php?dialect=json&panel=$1&%{QUERY_STRING} [L]
# Pass render requests through the render portal
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*stats/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*api/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*javascript/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^render/(.*)$ render.php?panel=$1&%{QUERY_STRING} [L]
# Pass stats requests through the stats portal
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*api/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*javascript/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^stats/(.*)$ stats.php?panel=$1&%{QUERY_STRING} [L]
# Pass api requests through the api portal
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*javascript/.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^api/(.*)$ api.php?panel=$1&%{QUERY_STRING} [L]
# Minify a javascript bundle
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^javascript/min/(.*)$ resource.php?resources=$1&type=js&minify=true&%{QUERY_STRING} [L]
# Produce a javascript bundle
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*style/.*$ [NC]
rewriterule ^javascript/(.*)$ resource.php?resources=$1&type=js&%{QUERY_STRING} [L]
# Minify a style bundle
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
rewriterule ^style/min/(.*)$ resource.php?resources=$1&type=css&minify=true&%{QUERY_STRING} [L]
# Produce a style bundle
RewriteCond %{REQUEST_FILENAME} !^.*\.(png|gif|jpg|css|js|swf|flv|otf|ttf|tpl)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
rewriterule ^style/(.*)$ resource.php?resources=$1&type=css&%{QUERY_STRING} [L]