The MU forums have moved to WordPress.org

Hostname Change causes infinite 302 Canonical Redirect (3 posts)

  1. RKM
    Member
    Posted 14 years ago #

    I've recently installed WPMU for the first time, and love it.

    One thing I did wrong, was to setup initially under the domain, without a hostname. For example, my initial setup was under "domain.com" rather than "www.domain.com".

    I continued testing for about a week, then went to change the WPMU setup to be "www.domain.com" (adding the 'www' hostname in front of my domain). That initial change was done through the Admin Dashboard. When it didn't work, I continued with additional changes:

    * WPMU Administration Dashboard
    * Replaced every instance of the hostname in the MySQL wordpress database, and verified the alterations.
    * wp-config.php
    * Removed .htaccess to be safe
    * Linux system's hostname (which was the FQDN from the start, so it didn't need to be changed)
    * httpd.conf (also correct from the start, so it didn't require to be changed)

    What happens, is that Apache/PHP/WP are running fine. When I request the default page at: http://www.domain.com, I get a "302 FOUND" redirect to:

    http://www.domain.com/wp-signup.php?new=domain.com

    Notice that it's attempting to redirect me to the proper location (www.*) but it thinks I'm coming from the old location (domain.com -- old location without 'www' hostname) despite the fact that I've requested the correct FQDN (www.domain.com).

    It loops this 302 attempt over-and-over, until it gives-up at 21 attempts.

    I've searched ...and searched... Without luck. I'm hoping someone hear has some ideas?

    Thank you in advance,
    RKM

  2. RKM
    Member
    Posted 14 years ago #

    I'm sorry, I should have provided these details as well:

    * Running WPMU 2.9.2, configured in "Sub-Domains" mode
    * No plug-ins or other customizations
    * No special themes (simply running the "Kubrick" default, with the default content). Single blog only, still haven't added any blogs/content.
    * Tested with default .htaccess (and without) -- same problem
    * FQDN resolution is working fine and worked fine prior to my adding "www." to the domainname; successfully tested WPMU this was for a week.

    Thank you for taking the time to review :-)

  3. RKM
    Member
    Posted 14 years ago #

    Whew.. Spent about 6-7 hours before I figured this out. Thought I'd post back to the forum, in the event someone else runs into this and searches for this topic.

    I learned that when adding a hostname (eg "www") that although we should replace all references to the original domain in the database, we should leave the "wp_blogs.domain" column as "domain.com" *without* the hostname.

    I finally discovered this when it hit me that I should enable verbose logging in MySQL, to help troubleshoot this issue (to do that, use the command "log-bin" in the /etc/my.cnf file).

    Then it required two attempts to the page (the first time activated the "new" querystring link, the second worked).

    IN SUMMARY:
    It appears that if you want a host to respond at "www.mysite.com" you must set the "domain" column of the "blogs" scree to "mysite.com", then set the "Siteurl" to "www.mysite.com".

    I'll create a separate thread to verify whether this is true; however, that's my preliminary info for those of you who might find yourselves here.

About this Topic