// Filter for redirecting on wrong server name (e.g. bad.your-server.tld will be redirected to your-server.tld)
function FILTER_REDIRECT_WRONG_SERVER_NAME ($filterData) {
+ // Get URL
+ $url = getUrl();
+
// Is the configured URL same as SERVER_NAME?
- if (extractHostnameFromUrl(getUrl()) != detectServerName()) {
+ if (extractHostnameFromUrl($url) != detectServerName()) {
// Then redirect to configured URL
redirectToRequestUri();
} // END - if