Sometimes PATH_INFO is in there anyway, so this gives us SCRIPT_NAME without relying on mod_rewrite, should be cross-platform.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-05 02:06:16 +00:00
parent acbdd5c97d
commit 8de73e88b2
1 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,9 @@ header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
// If someone has moved WordPress let's try to detect it
if ( isset( $_SERVER['PATH_INFO'] ) )
$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );