I think I'm missing a WWW somewhere. I get redirect loop

I think I’m missing a WWW somewhere. I get redirect loop errors when I visit my blog domains.

What did I do wrong?

  • Jeff Brown
    • Flash Drive

    I’ve tried adding and removing WWW in URLs under the Domain Mapping settings. I’ve also tried adding and removing:

    define(‘DOMAIN_CURRENT_SITE’, ‘domain’:wink:;

    define(‘PATH_CURRENT_SITE’, ‘/’:wink:;

    define(‘SITE_ID_CURRENT_SITE’, 1);

    define(‘BLOG_ID_CURRENT_SITE’, 1);

    No dice so far…

  • Jeff Brown
    • Flash Drive

    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ – [L]

    # add a trailing slash to /wp-admin

    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^ – [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    RewriteRule . index.php [L]

  • Shawn
    • The Crimson Coder

    That wouldn’t have affected a www/wwwithout redirection loop.

    Can you look inside this table for the domain in question and make sure it’s in there only once:


    It’s also possible that your environment/host isn’t actually setup with both www and wwwithout in the same virtual host. Some providers think they’re doing a favor to their users by setting up an additional vhost with or without www that only captures the URL and redirects to it in the other format. This will usually be in your control panel in a ‘redirects’, ‘301’ or in a ‘www’ block.

    If you share one of these domains I’m happy to look and see exactly how they’re being redirected – if they’re not on the new host currently, I’ll need to the domain and the new IP address so I can add it to my hosts file.

  • Jeff Brown
    • Flash Drive

    I checked wp_domain_mapping and there are only two entries listed, one for each sub-site.

    WebFaction’s panel lets you add multiple domains to one installation, which I have done properly — I don’t think there’s an issue there.

    The weird thing is I have domain mapping working with another installation. There’s a specific misconfiguration affecting this Multisite and I can’t seem to pinpoint it.

    Thanks for your help. Any more ideas?

  • Shawn
    • The Crimson Coder

    Are the domains listed under wp_site ?

    Are you using CNAME or A records? Both are usually fine, but A records tend to propagate more quickly.

    Did you add HOSTS records for each domain to direct to the new IP address, or were you using the published DNS when you attempted the switch? Using HOSTS would avoid potential DNS publishing delays.

    Did you try in a different browser or after a reboot? You *must* reboot and/or purge the DNS cache to avoid potential browser caching of redirects.

  • Jeff Brown
    • Flash Drive

    The domains are not listed under wp_site…

    I am using Cloudflare for DNS so I just swapped the IP address out — no DNS change was necessary. I did not add entries in HOSTS.

    I tried different browsers and manually clearing cache via Terminal (Mac).

  • Shawn
    • The Crimson Coder

    Then it’s possible that it’s a cloudflare thing. The first thing I would do is try it without any proxy or caching enabled – cloudflare is a caching proxy, so that could very well be the problem.

    Try adding the domains with their new IP addresses to your “/etc/hosts” file – see if they still have the loops. If it still experiences the loops, and you’re not comfortable posting the domain names or IP publicly you can send it to me at s@12pd.com

  • Jeff Brown
    • Flash Drive

    OK so I’ve been clicking around and I found this error in Network Settings:

    Warning: strpos(): Empty needle in /home/bmsole/webapps/wp_multi_bms/wp-admin/network.php on line 317

    Would that have anything to do with it? And regardless, does anyone know what this is and how to fix?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.