WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Getting ../wp-signup.php?new=mydomain.com loop (16 posts)

  1. superbear
    Member
    Posted 1 year ago #

    I'm really confused!
    I've configured WP for multisite with subdomains.
    I've modified WP-config.php and .htaccess as per Network Setup instructions.

    Everything appeared normal until I ran a Google search and tried creating a sitemap. I am experiencing 2 specific issues.

    1) If I Google my site and click on the link it takes me to: http://www.mydomain.com/wp-signup.php?new=mydomain.com

    2) When I try to create a sitemap.xml for the 19 pages of my website using Godaddy cPanel or a WP Plugin, it gives me:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
    <loc>http://mydomain.com/</loc>
    </url>
    <url>
    <loc>http://mydomain.com/wp-signup.php?new=mydomain.com</loc>
    </url>
    </urlset>

    I looked an an older post here and tried changing WP-config.php from:

    define( 'SUBDOMAIN_INSTALL', true );

    to
    define( 'SUBDOMAIN_INSTALL', false );

    That fixed problem (1), but my www and subdomains no longer appeared in my Dashboard list of sites and were replaced by "\", and I was still unable to build a sitemap.

    Can anyone advise what I am doing wrong?

    Many Thanks in advance :-)

  2. Change subdomain install back to true, first of all. That settings is:

    True: I am using subdomains (i.e. sub.domain.com)
    False: I am using sub folders (i.e. domain.com/folder)

    Now, double check what's being redirected.

    I'm betting either http://www.domain.com OR domain.com is redirecting, but not both. Once you know which it is, you can set up a .htaccess rule to force it the other way.

  3. superbear
    Member
    Posted 1 year ago #

    Hi Ipstenu,

    OK. I've reverted to subdomain, but not sure how to "check" the redirect; but I can say that Google organic search lists the site as domain.com (without the www) and same with Chrome when I mouse over the link.

    Not to distract, but do you have any thoughts about the sitemap issue?

    Cheers :-)

  4. superbear
    Member
    Posted 1 year ago #

    OK... I was able to check the redirect.
    It's domain.com that redirects :-)

  5. superbear
    Member
    Posted 1 year ago #

    Hi again Ipstenu,

    I added a rule to .htaccess that redirects non-www to www:

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    This resolves issue (1) and (2), HOWEVER, when I try to connect to a subdomain of my multisite newtwork (subdomain.domain.com) the browser gives up and displays the "too many redirects" message.

    Can you tell me if there is another rule I can use that resolves this conundrum?

    Thanks again :-)

  6. When you try to connect, or when you try to log in?

  7. superbear
    Member
    Posted 1 year ago #

    The redirect rule I added to .htaccess won't allow me to connect to the subdomain directly in browser, or via WP Dashboard (Sites).

    As regards login, when a user creates a new subdomain site, a link is generated (newsubdomain.domain.com/wp-login.php. As soon as I click on the "Log-in" link, the redirect takes me to: http://www.newsubdomain.domain.wp-login.php Login fails due to the www being added as a prefix. :-(

    It appears to me that if a non-www to www redirect is added to .htaccess, it's going to do its job and convert all subdomains to www.

    I hope you can think of an alternative. Fingers crossed :-)

  8. RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    That says "Any time someone comes to a NON www domain, redirect!"

    You need to have something more specific, and it really depends on what your DEFAULT is.

    When you go to your primary domain, is it http://www.domain.com or domain.com?

  9. superbear
    Member
    Posted 1 year ago #

    Hi Ipstenu,
    Thank you for sticking with me on this :-)

    OK. I understand, but haven't any experience coding for .htaccess. If there is a resource you can suggest for that, I will be happy to take a look.

    But, just in case you can help with a snippet or two of code, here's how my site is setup:

    1) The primary domain is http://www.domain.com
    2) Users do not register directly via http://www.domain.com
    3) I am using a plugin (WP-Client) which acts as a HUB for direct communications with customers.
    4) To access the HUB, a new customer registers using the WPC registration form (http://www.domain.com/client-registration/).
    5) WPC registers customers in its own database, but they automatically become registered Users of the http://www.domain.com site.
    5) WP Multisite Registration Settings are set to "Logged in users may register new sites."
    6) Customers are automatically logged-in after registration, or using http://www.domain.com/wp-admin/
    7) Logged-in customers do not have access to http://www.domain.com user dashboard, only WPC HUB interface (page).
    8) WPC customers can create their own subdomain site on our www domain (customer.domain.com). They use this site to promote their own products and services.

    It's at this point that the current system fails because the redirect converts "customer.domain.com/wp-login" to "www.customer.domain.com/wp-login"

    So, I think I need a .htaccess rule that says:

    If subdomain of domain.com, don't add WWW
    If domain.com add WWW

    Do you agree?

    Many Thanks :-)

  10. superbear
    Member
    Posted 1 year ago #

    CORRECTION!
    My primary domain is: domain.com (currently adding WWW with .htaccess rule)

    But the .htaccess rules I suggested are correct:

    If subdomain of domain.com, don't add WWW
    If domain.com add WWW

    Kind Regards :-)

  11. superbear
    Member
    Posted 1 year ago #

    BTW, I find it confusing that in the WordPress Dashboard > Sites, under Domain, my site is listed as http://www.domain.com regardless of what is in the .htaccess file

    :-)

  12. Well... Here's the thing. You used www even though the install for Multisite outright tells you not to. So this is what happens sometimes, and this is why you will see I spend a lot of time telling people not to use WWW. It works most of the time, but when it doesn't, boy does it die ugly.

    # Redirect non-www urls to www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    That will ONLY check for example.com and, if found, force www. It won't touch your subdomains.

  13. superbear
    Member
    Posted 1 year ago #

    Well, I feel like a little child. LOL! (and I'm 57 this year too!!!) :-)
    I don't remember deliberately choosing www, but then again, I did spend 8 hours getting out of the first mess I created and was punch drunk by the time I got around to the re-install.

    Anyway, all's well that ends well, and I can't thank you enough for your help with my fledgling site. I just hope it manages to make me a few bucks after all this.

    Your code has worked a charm. I only hope that Google won't penalize me for some reason or other. I've also spent an age working on the SEO.

    Thank you again, and hopefully you won't be hearing from me again anytime soon.

    Keep up the great work!
    Bon courage and Warm regards,
    Damon

  14. Nah, Google won't hurt :) The 301 is a safe redirect.

    And don't sweat it. In the long run, this is how we've always learned best. Making mistakes ;)

  15. erdmask
    Member
    Posted 1 year ago #

    Good day I also have almost the same problem. When I visit site via browser everything works fine, buy when I visit it via any other device it redirect me to http://www.mydomain.com/wp-sighup.php?new=mydomain.com. Any ideas?

  16. Itookmyprozac
    Member
    Posted 1 year ago #

    Hi,

    In my case, the code posted by Ipstenu did not work until I pasted it just bellow the line #END WordPress

    Then, the redirection to www. started working. By the way, thank you Ipstenu!

Topic Closed

This topic has been closed to new replies.

About this Topic