1 |
8038
|
aaronmk
|
RewriteEngine on
|
2 |
8446
|
aaronmk
|
RewriteOptions AllowNoSlash InheritBefore
|
3 |
8038
|
aaronmk
|
|
4 |
8444
|
aaronmk
|
SetEnvIf Request_URI ^ innermost_dir=phpPgAdmin
|
5 |
|
|
|
6 |
12175
|
aaronmk
|
# remove trailing / (not used)
|
7 |
|
|
RewriteRule ^(.*)/$ $1 [discardpath,noescape,qsappend]
|
8 |
8485
|
aaronmk
|
|
9 |
12175
|
aaronmk
|
# extract base URL
|
10 |
|
|
RewriteRule ^\[(.*)\](?:/(.*))?$ $2 [discardpath,noescape,qsappend,env=base_url:http://$1]
|
11 |
|
|
|
12 |
|
|
# extract path components 1st->last
|
13 |
|
|
RewriteRule ^ - [discardpath,noescape,qsappend,env=page:servers]
|
14 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?server=$1 [discardpath,noescape,qsappend,env=page:all_db]
|
15 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?database=$1 [discardpath,noescape,qsappend,env=page:schemas]
|
16 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?schema=$1 [discardpath,noescape,qsappend,env=page:tables]
|
17 |
12177
|
aaronmk
|
RewriteRule ^views()$ $1 [discardpath,noescape,qsappend,env=page:views]
|
18 |
12175
|
aaronmk
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?table=$1 [discardpath,noescape,qsappend,env=page:tblproperties]
|
19 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?column=$1 [discardpath,noescape,qsappend,env=page:colproperties]
|
20 |
|
|
|
21 |
|
|
# redirect to now-constructed URL
|
22 |
|
|
RewriteCond %{ENV:base_url} !=""
|
23 |
|
|
RewriteRule ^$ %{ENV:base_url}/%{ENV:page}.php [discardpath,last,noescape,qsappend,redirect]
|
24 |
|
|
|
25 |
|
|
## for internal URLs
|
26 |
|
|
|
27 |
8485
|
aaronmk
|
# auto-add trailing / (dir without trailing / is absolute filesystem path)
|
28 |
|
|
RewriteCond %{ENV:innermost_dir} =phpPgAdmin
|
29 |
8507
|
aaronmk
|
RewriteRule ^/ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
|