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 |
13114
|
aaronmk
|
#
|
14 |
|
|
# phpPgAdmin bug causes page to be ignored when not logged in. this is partially
|
15 |
|
|
# fixed by also specifying subject, which is not ignored. (however, when it
|
16 |
|
|
# falls back to using subject, it will go to the last selected tab, not the
|
17 |
|
|
# default, leftmost tab.)
|
18 |
|
|
#
|
19 |
|
|
# subject values @ /usr/share/phppgadmin/classes/Misc.php#getSubjectParams()
|
20 |
|
|
RewriteRule ^ - [discardpath,noescape,qsappend,env=subject:root,env=page:servers]
|
21 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?server=$1 [discardpath,noescape,qsappend,env=subject:server,env=page:all_db]
|
22 |
13458
|
aaronmk
|
RewriteRule ^([^/]+)\.php(?:/(.*))?$ $2 [discardpath,noescape,qsappend,env=subject:schema,env=page:$1]
|
23 |
13114
|
aaronmk
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?database=$1 [discardpath,noescape,qsappend,env=subject:database,env=page:schemas]
|
24 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?schema=$1 [discardpath,noescape,qsappend,env=subject:schema,env=page:tables]
|
25 |
|
|
RewriteRule ^(views|functions)()$ $2 [discardpath,noescape,qsappend,env=subject:schema,env=page:$1]
|
26 |
|
|
RewriteRule ^view=([^/]+)(?:/(.*))?$ $2?view=$1&action=definition [discardpath,noescape,qsappend,skip=2,env=subject:view,env=page:viewproperties]
|
27 |
|
|
RewriteRule ^fn.oid=([^/]+)(?:/(.*))?$ $2?function_oid=$1&action=properties [discardpath,noescape,qsappend,skip=1,env=subject:function,env=page:functions]
|
28 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?table=$1 [discardpath,noescape,qsappend,env=subject:table,env=page:tblproperties]
|
29 |
|
|
RewriteRule ^([^/]+)(?:/(.*))?$ $2?column=$1 [discardpath,noescape,qsappend,env=subject:column,env=page:colproperties]
|
30 |
12175
|
aaronmk
|
|
31 |
|
|
# redirect to now-constructed URL
|
32 |
|
|
RewriteCond %{ENV:base_url} !=""
|
33 |
13114
|
aaronmk
|
RewriteRule ^$ %{ENV:base_url}/%{ENV:page}.php?subject=%{ENV:subject} [discardpath,last,noescape,qsappend,redirect]
|
34 |
12175
|
aaronmk
|
|
35 |
|
|
## for internal URLs
|
36 |
|
|
|
37 |
8485
|
aaronmk
|
# auto-add trailing / (dir without trailing / is absolute filesystem path)
|
38 |
|
|
RewriteCond %{ENV:innermost_dir} =phpPgAdmin
|
39 |
8507
|
aaronmk
|
RewriteRule ^/ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
|