11

So I just setup my website fightify.com and as you will see, visitors are automatically redirected to a signup page, which shouldnt be happening.

This only occurs if the domain is typed without the www. prefix. www.fightify.com yields no errors.

I have a feeling that it has something to do with the .htaccess file, but I'm no coder, and have no idea how to fix it.

Has anybody seen this happen before?

3 Answers 3

13

Yes, I've dealt with this before. You have to specify a NOBLOGREDIRECT in your wp-config.php file:

define( 'NOBLOGREDIRECT', 'http://www.fightify.com' );

If there's no site, WP has to redirect visitors somewhere. By default, that's the signup page. Adding that constant tells it where to go.

4
  • @marketer365: since it worked, could you please mark my answer as accepted? Mar 17, 2011 at 16:46
  • I've set NOBLOGREDIRECT and requests for the main site that should 404 instead redirect 302 -> 200 to the NOBLOGREDIRECT URL. Apparently this is the intended behavior but it surprised me and it seems wrong.
    – sam
    Aug 9, 2012 at 18:01
  • 2
    The solution to the 404 problem can be found here: remove_action( 'template_redirect', 'maybe_redirect_404' );
    – brasofilo
    Jul 17, 2013 at 17:56
  • @brasofilo been long but still useful. Should be added to the Answer. Without that every 404 request will also be redirected to NOBLOGREDIRECT.
    – Yatix
    Dec 15, 2016 at 9:19
2

I handle this issue with the WordPress MU Domain Mapping plugin.

I run my WP3 Network in subdirectory mode, and just assign domain names via the plugin, including any alternate domains. It's worked well for me, thus far.

-2

If you have moved your site recently, search in your database for any references to the old site and update accordingly. If you're using multisite, this can sometimes be in a few places in the database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy