Project

General

Profile

« Previous | Next » 

Revision 13622

web/.htaccess, username_prefix.php: username-based prefix subpaths: support dotpath in query string (which will be appended verbatim to the prefix). use "__?@__" instead of "__?__&" to signal username-based prefix, so that the query string does not end in a dangling & .

View differences:

.htaccess
13 13

  
14 14
SetEnvIf Request_URI ^ innermost_dir=/
15 15

  
16
# handle username-based prefix subpaths of the form "subpath@url?" or "__?__&"
17
# supports multiple @ , nested . , & query str: a@b.c@url?k=v& -> url?b.c.a&k=v
16
# handle username-based prefix subpaths of the form "subpath@url?" or "__?@__"
17
# supports multiple @ , nested . , & query str: a@b.c@url?@.d&q -> url?b.c.a.d&q
18
# ( @ is effectively a placeholder for the decoded username prefix)
18 19
# better than subpath.host because case is preserved and special chars allowed
19 20
# must require trailing ? , to avoid needing login to view the page itself
20 21
# must come before other redirects, because they lose the username
21
RewriteCond %{THE_REQUEST} "[?&] \S+$"
22
RewriteCond %{THE_REQUEST} "\? \S+$" [ornext]
23
RewriteCond %{QUERY_STRING} ^@
22 24
RewriteRule ^ username_prefix.php [discardpath,last,noescape,qsappend]
23 25

  
24 26
# remove www subdomain

Also available in: Unified diff