[wp-trac] [WordPress Trac] #15478: Wordpress (MU) doesn't consider $_SERVER['REDIRECT_URL']
WordPress Trac
wp-trac at lists.automattic.com
Thu Nov 18 21:44:05 UTC 2010
#15478: Wordpress (MU) doesn't consider $_SERVER['REDIRECT_URL']
-------------------------+--------------------------------------------------
Reporter: fmaz008 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.1
Severity: minor | Keywords:
-------------------------+--------------------------------------------------
Hi,
I've a special case with a site using wordpress site only for specific
part of it.
At the root of my site, I have the following /.htaccess file:
{{{
RewriteEngine On
RewriteBase /
RewriteRule ^bar/(.*)$ foo/bar/$1 [L]
}}}
The idea is that I want to emulate[[BR]]
/bar/[[BR]]
/foo/[[BR]]
[[BR]]
Where /foo/ is the main wordpress MU installation, and /foo/bar/ is an
additionnal site. Now the problem: if I access /bar/, I'll have the /foo/
site showing up, and tell me the bar article is not found.
The problem is that Wordpress only look out for REQUEST_URI, and never for
REDIRECT_URL.
I can't figure out where is the exact route handler in wordpress, so I've
not been able to make a full-fix yet, but for now, I think a part of the
problem might reside in wp-includes/classes.php, WP::parse_request(), on
line ~159:
{{{
$req_uri = $_SERVER['REQUEST_URI'];
$req_uri_array = explode('?', $req_uri);
$req_uri = $req_uri_array[0];
}}}
My fix suggestion would be to replace the previous code by the following:
{{{
$req_uri = $_SERVER['REQUEST_URI'];
$req_uri_array = explode('?', $req_uri);
$req_uri = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] :
$req_uri_array[0];
}}}
But I still have the same problem, so I didn't put the fix at the good
place. I've made a search and the REQUEST_URI variable is used in 33
files. So if the parse_request is not the route parser...
... how can we make WordPress (MU) support parent Url Rewriting ?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15478>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list