Revision 13680
Added by Aaron Marcuse-Kubitza over 10 years ago
.htaccess | ||
---|---|---|
28 | 28 |
RewriteCond %{QUERY_STRING} ^.*$ |
29 | 29 |
RewriteRule ^.*$ $0?&%0 [discardpath,noescape] |
30 | 30 |
|
31 |
# handle username-based prefix subpaths of the form "__@host" or "__@host?query"
|
|
32 |
# *note*: paths and subdomains are *not* supported when using usernames
|
|
33 |
# supports multiple @ , nested . , query str: a@b.c@host?d&q -> host.?b.c.a.d&q
|
|
31 |
# handle username-based prefix subpaths of the form "__@host" |
|
32 |
# *note*: subdomains/paths/query strings are *not* supported with usernames
|
|
33 |
# supports multiple @ , nested .: a@b.c@host -> host.?b.c.a
|
|
34 | 34 |
# better than subpath.host because case is preserved and special chars allowed |
35 | 35 |
# **IMPORTANT**: to access the home page after visiting a URL with a username, |
36 | 36 |
# you must append . to the host (other pages are not affected by this problem) |
37 | 37 |
# must come before external redirects, because they lose the username |
38 |
# |
|
39 |
## doesn't have subdomain & host doesn't end in . (which disables usernames) |
|
38 | 40 |
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ |
39 |
# doesn't have subdomain & host doesn't end in . (which disables usernames) |
|
40 |
# doesn't have path (which disables usernames to avoid needing trailing . ) |
|
41 |
## doesn't have path (which disables usernames to avoid needing trailing . ) |
|
41 | 42 |
RewriteCond %{REQUEST_URI} =/ |
42 |
## original URL (if specified) also doesn't have path
|
|
43 |
# original URL (if specified) also doesn't have path |
|
43 | 44 |
RewriteCond %{REDIRECT_REQUEST_URI} ="" [ornext] |
44 | 45 |
RewriteCond %{REDIRECT_REQUEST_URI} =/ |
46 |
## doesn't have query string (which disables usernames to avoid trailing . ) |
|
47 |
RewriteCond %{QUERY_STRING} ="" |
|
45 | 48 |
# another RewriteRule (in a previous round) didn't turn off usernames |
46 | 49 |
RewriteCond %{ENV:REDIRECT_usernames_disabled} ="" |
47 | 50 |
RewriteRule ^.*$ username_prefix.php [discardpath,last,noescape,qsappend] |
Also available in: Unified diff
bugfix: web/.htaccess: username-based prefix subpaths: removed support for query strings because these are often used at the root level, and should then be treated as a regular dotpath rather than something with a username-based prefix