[wp-hackers] Allow redirects to subdomain with multisite?

John Reuning john at ibiblio.org
Fri Aug 26 01:07:07 UTC 2011

The original solution involved defining a customized version of
wp_validate_redirect(), but it was an 80% copy/paste.  I didn't
understand the allowed_redirect_hosts.  That works, and it's cleaner.
I can pull the redirect_to param out of the request, run some checks,
and add the hostname into the list.

Thanks for the help!


On Thu, Aug 25, 2011 at 4:24 PM, Michael D Adams <mda at blogwaffe.com> wrote:
>> Regardless, wp_validate_redirect is a pluggable function. You don't
>> have to edit the core code to modify it, just define the function
>> elsewhere, like in a plugin, and your version will replace the one in
>> the core.
> You can also attach something to the allowed_redirect_hosts filter.
> It doesn't have to add all your subdomains: just the one you're
> redirecting to at the moment.

More information about the wp-hackers mailing list