forked from project-open-data/db-to-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
24 lines (20 loc) · 787 Bytes
/
.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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dta/
#db + table + column + value
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^/]+)/([^/]+)/([^/]+)/([^/]+)\.([a-zA-Z]{3,4})$ index.php?db=$1&table=$2&column=$3&value=$4&format=$5 [L,QSA]
#db + table + #id
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^/]+)/([^/]+)/([^/]+)\.([a-zA-Z]{3,4})$ index.php?db=$1&table=$2&value=$3&format=$4 [L,QSA]
#db + table
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^/]+)/([^/]+)\.([a-zA-Z]{3,4})$ index.php?db=$1&table=$2&format=$3 [L,QSA]
#all else
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,QSA]
</IfModule>