wordpress relative url

edit wp-includes/functions.php

--
function get_option( $setting ) {
	global $wpdb;

	if (in_array($setting, array('siteurl', 'home'))) {
		if (ereg('(wp-includes)', $_SERVER['PHP_SELF'], $r)) {
			return ('http://'.$_SERVER['SERVER_NAME'].(
				substr(
					$_SERVER['PHP_SELF'], 0,
					strpos($_SERVER['PHP_SELF'], $r[0])
				)
			));
		} else if (ereg('wp-admin', $_SERVER['PHP_SELF'])) {
			return 'http://'.$_SERVER['SERVER_NAME']
			. dirname(dirname($_SERVER['PHP_SELF']));
		} else {
			$_SERVER_PHP_SELF = $_SERVER['PHP_SELF'];
			$_SERVER_SCRIPT_FILENAME = $_SERVER['SCRIPT_FILENAME'];
			while ($_SERVER_SCRIPT_FILENAME = dirname($_SERVER_SCRIPT_FILENAME)) {
				$_SERVER_PHP_SELF = dirname($_SERVER_PHP_SELF);
				if (file_exists($_SERVER_SCRIPT_FILENAME.'/wp-content')) {
					break;
				}
				if ($_SERVER_SCRIPT_FILENAME == '.') break;
			}
			return 'http://'.$_SERVER['SERVER_NAME'].$_SERVER_PHP_SELF;
		}
	}
--

Tags: ,

Comments are closed.