WordPress.org

Ready to get started?Download WordPress

Forums

Accessing my primary URL without the "www" redirects to signup.php (24 posts)

  1. Michelle Langston
    Theme Wrangler at Automattic
    Posted 4 years ago #

    I configured multisite on my site.

    Everything seems to be working except for one little snag.

    Whenever I try to access my primary domain without the "www", it redirects to http://www.myprimarydomain.com/wp-signup.php?new=myprimarydomain.com

    If type in "wwww.myprimarydomain.com", it shows my primary site normally, but if I leave out the "www", it redirects to signup.php.

    I tried going into the database to manually change the primary site URL, but it had no effect.

    Is there some sort of rule in .htaccess or setting I can change somewhere to make it so that I can access my primary blog either through http://myprimarydomain.com OR http://www.myprimarydomain.com?

    Thanks well in advance for any help!

  2. define( 'NOBLOGREDIRECT', 'www.myprimarydomain.com' )

    in wp-config.

  3. Michelle Langston
    Theme Wrangler at Automattic
    Posted 4 years ago #

    Thanks for your help. I added that code and I got this error:

    The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    This is the code I have in my wp-config:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.pondersphere.com' );
    define( 'NOBLOGREDIRECT', 'www.pondersphere.com');
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
  4. SmockLady
    Member
    Posted 4 years ago #

    Yes, I'm getting the exact same response as chellycat. Just posting here for reference sake.

  5. Lemme go diggin' gals. :)

  6. @thesmocklady - got your registration turned off? I know you're looking for a different reason than the OP. ;)

  7. Michelle Langston
    Theme Wrangler at Automattic
    Posted 4 years ago #

    Thanks, andrea_r! :)

  8. SmockLady
    Member
    Posted 4 years ago #

    andrea_r I've done it both ways, registration turned off or on and I get the same page. I don't want registration turned off as I am controlling optional private posts for registered members via a plugin.

  9. SmockLady
    Member
    Posted 4 years ago #

    let me also say that adding the noblogredirect code drastically slows down the load time of my legitimate pages.

  10. like I mentioned in the other thread, redirecting to the signup page for a non-existant blog is default behavior.

  11. SmockLady
    Member
    Posted 4 years ago #

    andrea_r, I got that so let me ask this way: is there any way with registration turned on to a have redirection of non-registered subdomains go to the main page not the wp-signup page?

    If not, is there any way with registration turned off to have redirection of subdomains go to the main page? I know I am supposed to be using the noblogredirection for this option, but I don't like that I get a browser error page saying that the redirection will never complete.

    I understand that redirection to the wp-signup is default, but I don't want the default behavior. I want to be able to allow users to sign up for reading my blog's private posts AND have non-existent blogs be redirected to the main page. A plugin maybe? I didn't want to go that route, but I will.

  12. There isn't a plugin.

    there is only:

    // If VHOST is 'yes' uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled)
    // For example, the browser will redirect to http://examples.com/ for the following:

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

    Commented text is what was originally in MU.

    So yeah. Typo if you noticed. ;) Put the http:// in the address.

  13. SmockLady
    Member
    Posted 4 years ago #

    woohoo!
    THAT worked as well as sped up the load time.

    Thank you so much for bearing with my questions and helping me work it out!

  14. asniezek
    Member
    Posted 4 years ago #

    hm.. it's not working..
    my wp-config

    define('WP_ALLOW_MULTISITE', true);
    
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.academica.org.pl' );
    define( 'NOBLOGREDIRECT', 'www.academica.org.pl' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    if I enter the site http://academica.org.pl, blog is not aviable, no pages.
    ;(

  15. dgilmour
    Member
    Posted 4 years ago #

    You've got http:// missing, you need:
    define( 'NOBLOGREDIRECT', 'http://www.academica.org.pl' );

    So yeah. Typo if you noticed. ;) Put the http:// in the address.

  16. asniezek
    Member
    Posted 4 years ago #

    I change from
    define( 'NOBLOGREDIRECT', 'www.academica.org.pl' );
    to
    define( 'NOBLOGREDIRECT', 'http://www.academica.org.pl' );

    and it still not working :(

  17. You have a typo somewhere.

    When I go to http://academica.org.pl it redirects me to kttp://www.academica.org.pl

    Are you using an .htaccess redirect?

  18. asniezek
    Member
    Posted 3 years ago #

    no.
    my htaccess looks like:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    when i change wp-config (add NOBLOGREDIRECT) and enter the http://academica.org.pl I have a blank webpage.

  19. Is that the full and complete htaccess?

    Also check your site settings in the admin side. There's a K somewhere in there. Three broswers ALL redirect to kttp.

  20. asniezek
    Member
    Posted 3 years ago #

    thats all :)
    I dont know what I should do :)

    Maybe I give access to my blog and someone will look on my configuration?

  21. Can you get in on the admin side and look at the blog options (from the edit screen off sites under super admin)? Failing that, check your wp-config file as well, or even your database, but you sound Ike you might need outside help :(

  22. gazouteast
    Member
    Posted 3 years ago #

    Looks like he's fixed the Http / Kttp issue, but still fully blank page when not using www in the browser address bar.

  23. blake______
    Member
    Posted 3 years ago #

    How can I get http://example.com/for-instance to redirect to http://www.example.com/for-instance, the way any Web user would expect? I've got define( 'NOBLOGREDIRECT', 'www.example.com' ) and it is redirecting except that in my example, my visitor would find himself at http://www.example.com instead of http://www.example.com/for-instance.

    We use www consistently on our site but example.com and http://www.example.com are synonymous for a normal Web server and I can't direct them to our homepage rather than the page they typed in. This worked fine before I turned multisite on, but I can't find a way to get it working again. Any idea?

  24. flanselle
    Member
    Posted 3 years ago #

    Hello,
    I've added this to my theme, functions.php and it works :

    function ms_block_wp_signup() {
    if( strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) !== false ) {
    wp_redirect( get_option('siteurl') );
    die;
    }
    }
    add_action('wp', 'ms_block_wp_signup', 99);

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.