-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
98 lines (86 loc) · 5.77 KB
/
.htaccess
File metadata and controls
98 lines (86 loc) · 5.77 KB
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
# Allow parsing of .html by PHP
AddType application/x-httpd-php .html .php
# Log all errors and warnings
php_value error_reporting -1
# Disallow pathinfo
AcceptPathInfo Off
# Disable output buffering
php_flag output_buffering Off
# Permit file uploads; NB has to be set at webserver or php.ini level (changeable only at PHP_INI_SYSTEM level)
#php_flag file_uploads On
# Run application pages
RewriteEngine On
RewriteRule ^$ index.html?action=home [L,QSA]
RewriteRule ^(suggest|current|audit|areas|embed|news|about|privacy|programme|terms|contacts|data|settings|admin|batch|login|logout|register|password|profile)/$ index.html?action=$1 [L,QSA]
RewriteRule ^(suggest|current|audit|areas|embed|news|about|privacy|programme|terms|contacts|data|settings|admin|batch|login|logout|register|password|profile)$ /$1/ [L,R=301]
RewriteRule ^(suggest|current|audit|terms)/iframe.html$ index.html?action=$1&iframe=1 [L,QSA]
RewriteRule ^(register)/([a-f0-9]{24})/?$ /index.html?action=$1&token=$2 [L]
RewriteRule ^(location)/([1-9][0-9]*)/$ index.html?action=$1&id=$2 [L,QSA]
RewriteRule ^(location)/([1-9][0-9]*)/iframe.html$ index.html?action=$1&id=$2&iframe=1 [L,QSA]
RewriteRule ^(location)/([1-9][0-9]*)$ /$1/$2/ [L,R=301]
RewriteRule ^(location)/([1-9][0-9]*)/(edit|like)/$ index.html?action=$1&id=$2&mode=$3 [L,QSA]
RewriteRule ^(location)/([1-9][0-9]*)/(edit)/iframe.html$ index.html?action=$1&id=$2&mode=$3&iframe=1 [L,QSA]
RewriteRule ^(location)/([1-9][0-9]*)/(edit|like)$ /$1/$2/$3/ [L,R=301]
RewriteRule ^(location)/([1-9][0-9]*)/problem/$ index.html?action=problem&id=$2 [L,QSA]
RewriteRule ^audit/location/([^/]+)/$ index.html?action=auditlocation&id=$1 [L,QSA]
RewriteRule ^(audit)/(location)/([^/]+)$ /$1/$2/$3/ [L,R=301]
RewriteRule ^audit/(priorityareas)/$ index.html?action=$1 [L,QSA]
RewriteRule ^audit/add/$ index.html?action=auditadd [L,QSA]
RewriteRule ^(audit)/(add|priorityareas)$ /$1/$2/ [L,R=301]
RewriteRule ^audit/add/([_a-z]+)/$ index.html?action=auditaddlocation&type=$1 [L,QSA]
RewriteRule ^(audit)/(add)/([_a-z]+)$ /$1/$2/$3/ [L,R=301]
RewriteRule ^(suggest|current|audit)/embed/$ index.html?action=embed&type=$1 [L,QSA]
RewriteRule ^(suggest|current|audit)/embed$ /$1/embed/ [L,R=301]
RewriteRule ^(suggest|audit)/([^/]+)/$ index.html?action=$1&category=$2 [L,QSA]
RewriteRule ^(suggest|audit)/([^/]+)$ /$1/$2/ [L,R=301]
RewriteRule ^data/(suggest|current|audit).csv$ index.html?action=download&dataset=$1 [L,QSA]
RewriteRule ^(news)/(add).html$ index.html?action=$1&mode=$2 [L,QSA]
RewriteRule ^(news)/([^/]+)/(add).html$ index.html?action=$1&mode=$3&area=$2 [L,QSA]
RewriteRule ^(news)/([^/]+)/$ index.html?action=$1&area=$2 [L,QSA]
RewriteRule ^(news)/([^/]+)$ /$1/$2/ [L,R=301]
RewriteRule ^(news)/(20[0-9][0-9])/([0-1][0-9])/([0-3][0-9])/([^/]+)/(edit|delete).html$ index.html?action=$1&mode=$6&date=$2-$3-$4&urlMoniker=$5 [L,QSA]
RewriteRule ^(news)/(20[0-9][0-9])/([0-1][0-9])/([0-3][0-9])/([^/]+)/$ index.html?action=$1&date=$2-$3-$4&urlMoniker=$5 [L,QSA]
RewriteRule ^(news)/(20[0-9][0-9])/([0-1][0-9])/([0-3][0-9])/([^/]+)$ /$1/$2/$3/$4/$5/ [L,R=301]
RewriteRule ^(batch)/cancel.html$ index.html?action=$1&do=cancel [L]
RewriteRule ^(admin)/(review|search|users|boroughs|priorityareas|login)/$ index.html?action=$1$2 [L,QSA]
RewriteRule ^(admin)/(review|search|users|boroughs|priorityareas|login)$ /$1/$2/ [L,R=301]
RewriteRule ^(admin)/(review)/page([1-9][0-9]*).html$ index.html?action=$1$2&page=$3 [L,QSA]
# Schemes/visions module; directives copied from the library
RewriteRule ^schemes/$ index.html?action=schemes&do=schemeslist [L]
RewriteRule ^schemes$ /schemes/ [L,R=301]
RewriteRule ^schemes/add.html$ index.html?action=schemes&do=schemeadd [L]
RewriteRule ^schemes/([^/]+)/$ index.html?action=schemes&do=schemeshow&scheme=$1 [L]
RewriteRule ^schemes/([^/]+)$ /schemes/$1/ [L,R=301]
RewriteRule ^schemes/([^/]+)/edit.html$ index.html?action=schemes&do=schemeedit&scheme=$1 [L]
RewriteRule ^schemes/([^/]+)/addvision.html$ index.html?action=schemes&do=visionadd&scheme=$1 [L]
RewriteRule ^schemes/([^/]+)/vision([1-9][0-9]*)/$ index.html?action=schemes&do=visionshow&scheme=$1&vision=$2 [L]
RewriteRule ^schemes/([^/]+)/vision([1-9][0-9]*)$ /schemes/$1/$2/ [L,R=301]
RewriteRule ^schemes/([^/]+)/vision([1-9][0-9]*)/edit.html$ index.html?action=schemes&do=visionedit&scheme=$1&vision=$2 [L]
# AJAX calls
RewriteRule ^ajax/([a-z]+)$ index.html?action=ajax&call=$1 [L,QSA]
# Geographical cities, e.g. /cambridge, matching last
RewriteRule ^([-a-z]+)/$ index.html?action=city&id=$1 [L,QSA]
RewriteRule ^([-a-z]+)$ /$1/ [L,R=302]
# If no match above, serve files from the style folder directly, via the web application, for the configured style, other than specified static files
RewriteCond %{REQUEST_FILENAME} !/.well-known
RewriteCond %{REQUEST_FILENAME} !/index\.html$
RewriteCond %{REQUEST_FILENAME} !/robots\.txt$
RewriteCond %{REQUEST_FILENAME} !/css/generic\.css$
RewriteCond %{REQUEST_FILENAME} !/css/telluswhere\.css$
RewriteCond %{REQUEST_FILENAME} !/images/gps\.png$
RewriteCond %{REQUEST_FILENAME} !/images/multipleupload\.png$
RewriteCond %{REQUEST_FILENAME} !/images/ui-anim_basic_16x16\.gif$
RewriteCond %{REQUEST_FILENAME} !/images/spinner\.svg$
RewriteCond %{REQUEST_FILENAME} !/images/whatsapp\.png$
RewriteCond %{REQUEST_FILENAME} !/images/categories
RewriteCond %{REQUEST_FILENAME} !/images/general
RewriteCond %{REQUEST_FILENAME} !/images/icons
RewriteCond %{REQUEST_FILENAME} !/images/news
RewriteCond %{REQUEST_FILENAME} !/js/lib/
RewriteCond %{REQUEST_FILENAME} !/js/telluswhere\.js$
RewriteCond %{REQUEST_FILENAME} !/js/autocomplete\.js$
RewriteCond %{REQUEST_FILENAME} !/images/geometrydrawing\.png$
RewriteCond %{REQUEST_FILENAME} !/tmp/batch-[0-9a-f]+/.+.jpg$
RewriteCond %{REQUEST_FILENAME} !/libraries/streetvisions/css/
RewriteCond %{REQUEST_FILENAME} !/libraries/streetvisions/js/
RewriteRule ^(.*)$ index.html?file=/$1 [L]