function themekey_redirect_check_different_url in ThemeKey 7.3
Avoid a redirect loop by not redirecting to current domain.
Parameters
$url:
Return value
bool
1 call to themekey_redirect_check_different_url()
1 string reference to 'themekey_redirect_check_different_url'
- themekey_redirect_match_rules in themekey_redirect/
themekey_redirect.module
File
- themekey_redirect/
themekey_redirect.module, line 253 - Define rules to redirect the user to a different domain. The common use-case is to setup sub-domains for mobile sites. In this case you can configure ThemeKey Redirect to detect mobile clients and redirect the user accordingly. In ThemeKey itself you…
Code
function themekey_redirect_check_different_url($url) {
$parts = parse_url($url);
$host = $parts['host'];
if (isset($parts['port']) && $parts['port'] != 80 && $parts['port'] != 443) {
$host .= ':' . $parts['port'];
}
return $host != $_SERVER['HTTP_HOST'];
}