Support » Plugin: WP Subdomains (Revisited) » Commenters redirected to admin dashboard instead of comment

  • Hi there, and thanks for the awesome plugin!

    Unfortunately it seems our commenters, me included, are redirected to /wp-admin/ after sending a comment. The reason seems to be that the subdomains are not whitelisted in allowed_redirect_hosts, so that wp_safe_redirect removes the good location and replaces it with the admin dashboard, which most of our commenter don’t have access to.

    I’ve hardcoded our valid domains in wp-config.php for now, but you can probably easily add the same filter to the plugin.

    http://wordpress.org/plugins/wp-subdomains-revisited/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thank you for the tip! I’ve fixed the issue temporarily on my site too 🙂

    Just to be clear, all you did was edit and add this

    add_filter( 'allowed_redirect_hosts' , 'my_allowed_redirect_hosts' , 10 );
    function my_allowed_redirect_hosts($content){
    	$content[] = 'blog.example.com';
    	$content[] = 'codex.example.com';
    	// wrong: $content[] = 'http://codex.example.com';
    	return $content;
    }

    to wp-config.php?

    Precisely.

    Any updates planned before I get too committed using this? thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Commenters redirected to admin dashboard instead of comment’ is closed to new replies.