mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-08 17:38:26 +01:00
Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
git-svn-id: http://svn.automattic.com/wordpress/trunk@5889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d55ac9708c
commit
54639a391b
@ -27,11 +27,26 @@ if ( ! isset($blog_id) )
|
||||
|
||||
// Fix for IIS, which doesn't set REQUEST_URI
|
||||
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?
|
||||
|
||||
// Append the query string if it exists and isn't null
|
||||
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
|
||||
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
|
||||
// IIS Mod-Rewrite
|
||||
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
|
||||
}
|
||||
// IIS Isapi_Rewrite
|
||||
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
|
||||
}
|
||||
else {
|
||||
// If root then simulate that no script-name was specified
|
||||
if (empty($_SERVER['PATH_INFO']))
|
||||
$_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/';
|
||||
else
|
||||
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
|
||||
|
||||
// Append the query string if it exists and isn't null
|
||||
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
|
||||
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user