forked from catchpoint/WebPageTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
191 lines (167 loc) · 12 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#
#Friendly urls
#
<IfModule mod_rewrite.c>
# Tell PHP that the mod_rewrite module is ENABLED.
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
#main pages
RewriteRule ^about$ /about.php
RewriteRule ^traceroute$ /traceroute.php
RewriteRule ^mobile$ /mobile.php
RewriteRule ^tips$ /tips.php
RewriteRule ^pss$ /pss.php
RewriteRule ^compare$ /pss.php
RewriteRule ^blink$ /blink.php
#result paths
RewriteRule ^result/([a-zA-Z0-9_]+)$ /result/$1/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/$ /results.php?test=$1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/waterfall$ /result/$1/$2/details/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/waterfall/$ /result/$1/$2/details/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/details/$ /details.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/waterfall/cached$ /result/$1/$2/details/cached/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/waterfall/cached/$ /result/$1/$2/details/cached/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/details/cached/$ /details.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization$ /result/$1/$2/performance_optimization/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization/$ /result/$1/$2/performance_optimization/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/performance_optimization/$ /performance_optimization.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization/cached$ /result/$1/$2/performance_optimization/cached/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization/cached/$ /result/$1/$2/performance_optimization/cached/ [R]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/performance_optimization/cached/$ /performance_optimization.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/screen_shot/$ /screen_shot.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/screen_shot/cached/$ /screen_shot.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/breakdown/$ /breakdown.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/breakdown/cached/$ /breakdown.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/domains/$ /domains.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/domains/cached/$ /domains.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization_report/$ /optimization_report.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/optimization_report/cached/$ /optimization_report.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/pagespeed/$ /pagespeed.php?test=$1&run=$2 [qsa]
RewriteRule ^result/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/pagespeed/cached/$ /pagespeed.php?test=$1&run=$2&cached=1 [qsa]
RewriteRule ^testlog/([0-9]+)$ /testlog/$1/ [R]
RewriteRule ^testlog/([0-9]+)/$ /testlog.php?days=$1 [qsa]
RewriteRule ^xmlResult/([a-zA-Z0-9_]+)/$ /xmlResult.php?test=$1 [qsa]
RewriteRule ^testlog.csv /testlog.php?f=csv [qsa]
RewriteRule ^waterfall.png /waterfall.php [qsa]
#old direct path to images
RewriteRule ^results/([a-zA-Z0-9])([a-zA-Z0-9]+)/([a-zA-Z0-9_]+).png$ /results/old/_$1/$1$2/$3.png
RewriteRule ^results/([a-zA-Z0-9])([a-zA-Z0-9]+)/([a-zA-Z0-9_]+).jpg$ /results/old/_$1/$1$2/$3.jpg
RewriteRule ^results/old/_([a-zA-Z0-9])/([a-zA-Z0-9]+)/([a-zA-Z0-9_]+).png$ /results/old/$2/$3.png
#csv combined results
RewriteRule ^result/([a-zA-Z0-9_]+)/.*page_data.csv$ /csv.php?test=$1
RewriteRule ^result/([a-zA-Z0-9_]+)/.*requests.csv$ /csv.php?test=$1&requests=1
#thumbnails
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_screen_thumb.jpg$ /thumbnail.php?test=$1&run=$2&file=$2_screen.jpg
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_Cached_screen_thumb.jpg$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_screen.jpg
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_waterfall_thumb.png$ /thumbnail.php?test=$1&run=$2&file=$2_waterfall.png
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall_thumb.png$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_waterfall.png
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_optimization_thumb.png$ /thumbnail.php?test=$1&run=$2&file=$2_optimization.png
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization_thumb.png$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_optimization.png
#old direct thumbnail paths
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_screen_thumb.jpg$ /thumbnail.php?test=$1&run=$2&file=$2_screen.jpg
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_screen_thumb.jpg$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_screen.jpg
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_waterfall_thumb.png$ /thumbnail.php?test=$1&run=$2&file=$2_waterfall.png
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall_thumb.png$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_waterfall.png
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_optimization_thumb.png$ /thumbnail.php?test=$1&run=$2&file=$2_optimization.png
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization_thumb.png$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_optimization.png
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_waterfall_thumb.gif$ /thumbnail.php?test=$1&run=$2&file=$2_waterfall.gif
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall_thumb.gif$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_waterfall.gif
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_optimization_thumb.gif$ /thumbnail.php?test=$1&run=$2&file=$2_optimization.gif
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization_thumb.gif$ /thumbnail.php?test=$1&run=$2&cached=1&file=$2_Cached_optimization.gif
# waterfalls
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_waterfall.png$ /waterfall.php?test=$1&run=$2
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall.png$ /waterfall.php?test=$1&run=$2&cached=1
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_waterfall.gif$ /waterfall.php?test=$1&run=$2
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall.gif$ /waterfall.php?test=$1&run=$2&cached=1
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_waterfall.png$ /waterfall.php?test=$1$2$3_$4&run=$5
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_waterfall.png$ /waterfall.php?test=$1$2$3_$4_$5&run=$6
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall.png$ /waterfall.php?test=$1$2$3_$4&run=$5&cached=1
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_Cached_waterfall.png$ /waterfall.php?test=$1$2$3_$4_$5&run=$6&cached=1
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_connection.png$ /waterfall.php?test=$1$2$3_$4&run=$5&type=connection
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_connection.png$ /waterfall.php?test=$1$2$3_$4_$5&run=$6&type=connection
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_Cached_connection.png$ /waterfall.php?test=$1$2$3_$4&run=$5&cached=1&type=connection
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_Cached_connection.png$ /waterfall.php?test=$1$2$3_$4_$5&run=$6&cached=1&type=connection
# optimization checklists
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_optimization.png$ /optimizationChecklist.php?test=$1&run=$2
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization.png$ /optimizationChecklist.php?test=$1&run=$2&cached=1
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_optimization.gif$ /optimizationChecklist.php?test=$1&run=$2
RewriteRule ^results/old/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization.gif$ /optimizationChecklist.php?test=$1&run=$2&cached=1
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_optimization.png$ /optimizationChecklist.php?test=$1$2$3_$4&run=$5
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_optimization.png$ /optimizationChecklist.php?test=$1$2$3_$4_$5&run=$6
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization.png$ /optimizationChecklist.php?test=$1$2$3_$4&run=$5&cached=1
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)_Cached_optimization.png$ /optimizationChecklist.php?test=$1$2$3_$4_$5&run=$6&cached=1
#location cookie dropping
RewriteRule ^loc/([a-zA-Z0-9_]+)$ /util/setloc.php?location=$1
RewriteRule ^loc/([a-zA-Z0-9_]+)$/ /util/setloc.php?location=$1
#gzip compressed text result files
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+).(txt|csv)$ /gettext.php?test=$1$2$3_$4&file=$5.$6
RewriteRule ^results/([0-9][0-9])/([0-9][0-9])/([0-9][0-9])/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+).(txt|csv)$ /gettext.php?test=$1$2$3_$4_$5&file=$6.$7
#tcpdump capture files
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+).cap$ /getgzip.php?test=$1&file=$2.cap
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_Cached.cap$ /getgzip.php?test=$1&file=$2_Cached.cap
#page speed
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_pagespeed.txt$ /getgzip.php?test=$1&file=$2_pagespeed.txt
RewriteRule ^result/([a-zA-Z0-9_]+)/([0-9]+)_Cached_pagespeed.txt$ /getgzip.php?test=$1&file=$2_Cached_pagespeed.txt
#embeddable video widget
RewriteRule ^video/embed/([a-zA-Z0-9_]+)$ /video/view.php?embed=1&id=$1
#widgets
RewriteRule ^widgets/pagespeed/tree$ /widgets/pagespeed/tree.php [qsa]
#old pages that were eliminated in the UI rewrite
RewriteRule ^test$ / [R]
# versioned path to timeline
RewriteRule ^timeline/[0-9]+/(.*)$ /chrome/$1
</IfModule>
#
#Caching for images
#
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A31536000
ExpiresByType image/jpg A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType image/png A31536000
ExpiresByType image/bmp A31536000
ExpiresByType text/css A31536000
ExpiresByType text/javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType application/x-javascript A31536000
</IfModule>
#
#Disable ETags
#
<IfModule mod_headers.c>
Header unset ETag
FileETag None
</IfModule>
#
#Disable directory browsing
#
Options -Indexes
#
# Block access to .inc and .ini files
#
<Files ~ "\.(inc|ini|gz)$">
order allow,deny
deny from all
</Files>
#
# Force text/javascript instead of application/javascript for js (Potentially remove this when MaxCDN fixes their compression)
#
<IfModule mod_mime.c>
AddType text/javascript .js
AddType application/dtas dtas
</IfModule>
# GZip Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE image/x-icon
</IfModule>