Revision 13617
Added by Aaron Marcuse-Kubitza over 10 years ago
username_prefix.php | ||
---|---|---|
8 | 8 |
} |
9 | 9 |
else |
10 | 10 |
{ |
11 |
$url = $_SERVER["REQUEST_URI"];
|
|
11 |
$subpath = user2path($_SERVER["PHP_AUTH_USER"]);
|
|
12 | 12 |
header("Location: ".($_SERVER["PHP_AUTH_USER"] !== "" |
13 |
? $url/*ends in ? */.user2path($_SERVER["PHP_AUTH_USER"]) |
|
14 |
: rtrim($url, "?") # if user empty, just display page |
|
13 |
? ($_SERVER["QUERY_STRING"] !== "" |
|
14 |
? /*prepend to query string*/$_SERVER["SCRIPT_URL"] |
|
15 |
."?.".$subpath."&".rtrim($_SERVER["QUERY_STRING"], "&") |
|
16 |
: $_SERVER["REQUEST_URI"]/*ends in ? */.$subpath |
|
17 |
) |
|
18 |
: rtrim($_SERVER["REQUEST_URI"], "?") #user empty->just display page |
|
15 | 19 |
)); |
16 | 20 |
} |
17 | 21 |
?> |
Also available in: Unified diff
web/.htaccess, web/username_prefix.php: username-based prefix subpaths: support query strings in addition to paths