Project

General

Profile

« Previous | Next » 

Revision 13459

bugfix: web/.phpPgAdmin/.htaccess: custom pages: need to handle in query string because .php filename would be treated as path element

View differences:

.htaccess
19 19
# subject values @ /usr/share/phppgadmin/classes/Misc.php#getSubjectParams()
20 20
RewriteRule ^                          -                                    [discardpath,noescape,qsappend,env=subject:root,env=page:servers]
21 21
RewriteRule ^([^/]+)(?:/(.*))?$        $2?server=$1                         [discardpath,noescape,qsappend,env=subject:server,env=page:all_db]
22
RewriteRule ^([^/]+)\.php(?:/(.*))?$   $2                                   [discardpath,noescape,qsappend,env=subject:schema,env=page:$1]
23 22
RewriteRule ^([^/]+)(?:/(.*))?$        $2?database=$1                       [discardpath,noescape,qsappend,env=subject:database,env=page:schemas]
24 23
RewriteRule ^([^/]+)(?:/(.*))?$        $2?schema=$1                         [discardpath,noescape,qsappend,env=subject:schema,env=page:tables]
25 24
RewriteRule ^(views|functions)()$      $2                                   [discardpath,noescape,qsappend,env=subject:schema,env=page:$1]
......
28 27
RewriteRule ^([^/]+)(?:/(.*))?$        $2?table=$1                          [discardpath,noescape,qsappend,env=subject:table,env=page:tblproperties]
29 28
RewriteRule ^([^/]+)(?:/(.*))?$        $2?column=$1                         [discardpath,noescape,qsappend,env=subject:column,env=page:colproperties]
30 29

  
30
# custom pages
31
# must be in query string b/c .php filename would be treated as path element
32
RewriteCond %{QUERY_STRING} ^(?:.*&)?page=([^&]*)
33
RewriteRule ^ - [discardpath,noescape,qsappend,env=!subject,env=page:%1]
34

  
31 35
# redirect to now-constructed URL
32 36
RewriteCond %{ENV:base_url} !=""
33 37
RewriteRule ^$ %{ENV:base_url}/%{ENV:page}.php?subject=%{ENV:subject} [discardpath,last,noescape,qsappend,redirect]

Also available in: Unified diff