302 Redirect loop on multisite

I’ve changed the domain of my multisite and added SSL. Now when accessing the new domain I’m getting into a 302 redirect loop which I can’t fix. Can you help?

  • Chris
    • Flash Drive

    I had the same issue. Unfortunately I couldn’t get that issue resolved on the multi site install but was able to fix it by adding a forward and deleting it from WordPress altogether. I’d love to hear a solution and an explanation of what went wrong with yours so I can understand if it happens to me again.

  • Nithin Ramdas
    • Support Wizard

    Hi Tim ,

    I’m checking your website homepage, and I don’t see any 302 redirect loop nor any such errors:
    ERR_TOO_MANY_REDIRECTS

    Have you fixed it? If not, could you please advise what’s being missed, along with a screenshot. If it occurs when logging in, please do share us with the login credentials so that we could check further.

    Since the ticket is public, you can send credentials by using our secure contact form: https://wpmudev.com/contact/#i-have-a-different-question

    – To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login URL

    Please do follow up on the ticket once you have sent the above credentials. Have a nice day.

    Kind Regards,
    Nithin

    NOTE: Please don’t share any sensitive information (i.e credentials) in the ticket. Support tickets are publicly visible and everyone will have access to it. Please make sure to use the contact form as mentioned above to share sensitive information.

  • Tim
    • Flash Drive

    Hi Nithin, I got my Server guys to look into yesterday and this is theri comments below. This was the issue I had when I initially changed the URL structure.

    It appears that the issue lies somewhere with your multidomain setup and domain URLs that you have configured. I have managed to get the website back online by commenting out the following 2 lines in wp-config.php

    // define( ‘MULTISITE’, true );
    // define( ‘SUBDOMAIN_INSTALL’, true );

    The website now shows correctly;

    [root@fgt-clst-02 themes]# curl -I https://www.westhillshopping.co.uk/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Fri, 03 Jan 2020 22:23:34 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Vary: Accept-Encoding
    X-Powered-By: PHP/5.6.40
    X-Pingback: https://www.westhillshopping.co.uk/xmlrpc.php
    Link: <https://www.westhillshopping.co.uk/wp-json/&gt;; rel=”https://api.w.org/&#8221;, <https://www.westhillshopping.co.uk/&gt;; rel=shortlink
    X-Powered-By: PleskLin

    If you require setting this up as a multisite then you will need to get your developers to look into this as setting up multisite wordpress domains isn’t something that is supported by UKFast.

    For reference, if you uncomment the MULTISITE constant shown above, this results in a redirect to an invalid URL “https://https://www.westhillshopping.co.uk/wp-signup.php?new=www.westhillshopping.co.uk&#8221; (notice the https://https://)

    [root@fgt-clst-02 themes]# curl -I https://www.westhillshopping.co.uk
    HTTP/1.1 302 Moved Temporarily
    Server: nginx
    Date: Fri, 03 Jan 2020 22:15:51 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    X-Powered-By: PHP/5.6.40
    Location: https://https://www.westhillshopping.co.uk/wp-signup.php?new=www.westhillshopping.co.uk
    X-Powered-By: PleskLin

    Essentially the man subdomain site is live but without the Multisite functionality and now has template issues because of the changes that have been made.

    I will send over the login details via the contact form. Would love to get a solution to this…

    Many thanks,
    Tim

  • Nithin Ramdas
    • Support Wizard

    Hi Tim ,

    Thanks for sharing the login, on checking it seems like the issue occurred after migration? On troubleshooting further, it seems to occur due to the wrong hardcoded URLs in the wp_sites, and wp_blogs tables on your database side.

    Once the URL of the main site was corrected in the mentioned tables, it seems to load fine. However, I could notice the subsites has a different URL compared to the main site URL on your multisite, so I suppose it’s a migrated site.

    The dashboard and the homepage should load fine now. To make sure the primary domain is used on all your Multisite and subsite, please check the following article:
    https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/

    Please do check, and let us know if you have any further query.

    Regards,
    Nithin

  • Tim
    • Flash Drive

    Hi Nithin,

    Many thanks for your help on this issue, very much appreciated. Your changes have helped massively. I have one more slight issue and that is the inability to login to the sub sites. Seems I am getting reauth=1 error which is talked about here (https://community.bitnami.com/t/wp-multisite-multidomains-cookies-issue/46603/5). However I have tried in multiple browsers without cookies etc but still can’t get in.

    Any ideas?

    Thanks

    Tim

  • Nithin Ramdas
    • Support Wizard

    Hi Tim ,

    We respond to tickets in order of oldest to newest, and hence a delay in getting back, sorry about that.

    I have one more slight issue and that is the inability to login to the sub sites. Seems I am getting reauth=1 error which is talked about here

    I could notice when I try to access the subsite dashboard the dashboard is throwing a login screen. However, I’m confused with the subsite URL.

    The main Site URL is:
    https://www.westhillshoxxxxx.co.uk/

    Subsite URLs are loaded as:
    westgate.westhill.frogboxdigxxxx.com

    Where the main site domain name are missing from the subsite URL.

    I created a test subsite, and this is how the URL was listed when it did include the main site URL:
    http://wpmutest.westhillshoxxxxx.co.uk/

    Just to be sure the existing subsites should be loading as:
    westgate.westhillshoxxxxx.co.uk

    Instead of:
    westgate.westhill.frogboxdigxxxx.com

    Right?

    Please advise the exact URL of how you are looking to load the subsites, so that we could check further.

    Regards,
    Nithin