Revision 13628
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/web/.htaccess | ||
---|---|---|
13 | 13 |
|
14 | 14 |
SetEnvIf Request_URI ^ innermost_dir=/ |
15 | 15 |
|
16 |
# auto-detect dotpath in query string (having a . or & before any = ) |
|
17 |
# you can prepend . to force a dotpath, or & to force a query param |
|
18 |
# must come before username prefix parsing, because it requires the leading "." |
|
19 |
RewriteCond %{QUERY_STRING} ^(?!@?[.&]).+$ |
|
20 |
# . not already prepended, does not start with & , and non-empty |
|
21 |
RewriteCond %{QUERY_STRING} ^@?[^=]*(?:[.&]|$) |
|
22 |
# . or & before any = |
|
23 |
RewriteCond %{QUERY_STRING} ^(@?)(.*)$ |
|
24 |
RewriteRule ^.*$ $0?%1.%2 [discardpath,noescape] |
|
25 |
|
|
16 | 26 |
# handle username-based prefix subpaths of the form "subpath@url?" or "__?@__" |
17 | 27 |
# supports multiple @ , nested . , & query str: a@b.c@url?@.d&q -> url?b.c.a.d&q |
18 | 28 |
# ( @ is effectively a placeholder for the decoded username prefix) |
19 | 29 |
# better than subpath.host because case is preserved and special chars allowed |
20 | 30 |
# must require trailing ? , to avoid needing login to view the page itself |
21 |
# must come before other redirects, because they lose the username
|
|
31 |
# must come before external redirects, because they lose the username
|
|
22 | 32 |
RewriteCond %{THE_REQUEST} "\? \S+$" [ornext] |
23 | 33 |
RewriteCond %{QUERY_STRING} ^@ |
24 | 34 |
RewriteRule ^ username_prefix.php [discardpath,last,noescape,qsappend] |
... | ... | |
47 | 57 |
RewriteRule ^([^/]*)(.*)$ %0$2 [discardpath,last,noescape,qsappend] |
48 | 58 |
# last: rewrite in the new subdir instead of applying this dir's rules |
49 | 59 |
|
50 |
# auto-detect dotpath in query string (having a . or & before any = ) |
|
51 |
# you can prepend . to force a dotpath, or & to force a query param |
|
52 |
RewriteCond %{QUERY_STRING} ^(?![.&]).+$ |
|
53 |
# . not already prepended, does not start with & , and non-empty |
|
54 |
RewriteCond %{QUERY_STRING} ^[^=]*(?:[.&]|$) |
|
55 |
# . or & before any = |
|
56 |
RewriteRule ^.*$ $0?.%{QUERY_STRING} [discardpath,noescape] |
|
57 |
|
|
58 | 60 |
## parse dotpath in query string |
59 | 61 |
# make dotpath replacement start with ./ instead of / |
60 | 62 |
RewriteCond %{QUERY_STRING} ^\. |
Also available in: Unified diff
web/.htaccess: auto-detect dotpath in query string: also auto-detect dotpath for query strings appended to a username-based prefix, so that these don't need to have . prepended to make them appendable