Quantcast
Channel: WordPress.org Forums » [WordPress MU Domain Mapping] Support
Viewing all articles
Browse latest Browse all 3502

meglio on "[Plugin: WordPress MU Domain Mapping] wordpress.com-like setup SSL problem"

$
0
0

Okay, I was able to solve the "early redirect" problem with an additional small plugin:

/* Redirect all administration and login to sub-domains  */
function datainserter_wp_redirect($location, $status = 'not interesting')
{
	if (!force_ssl_admin() || is_ssl())
		return $location;

	if (!function_exists('get_original_url'))
		return $location;

	if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') === false
		&& strpos($_SERVER['REQUEST_URI'], 'wp-admin') === false)
		return $location;

	$originalHost = parse_url(get_original_url( 'siteurl' ), PHP_URL_HOST);
	$locationHost = parse_url($location, PHP_URL_HOST);
	$location = str_ireplace($locationHost, $originalHost, $location);
	return $location;
}

add_filter('wp_redirect', 'datainserter_wp_redirect');

Viewing all articles
Browse latest Browse all 3502

Trending Articles