-
-
Save r-a-y/bc390ceb5d1872044e05b3aed35431c1 to your computer and use it in GitHub Desktop.
Allow WP MU subdomain redirects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow subdomain redirects. | |
* | |
* WordPress has strict redirect rules and for some reason, does not allow | |
* subdomain redirects even on the same domain. | |
*/ | |
add_filter( 'allowed_redirect_hosts', function( $retval, $subdomain ) { | |
if ( false !== strpos( $subdomain, 'sunygeneseoenglish.org' ) ) { | |
$retval[] = $subdomain; | |
} | |
return $retval; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment