Support » Networking WordPress » www.domain.com loads, but domain.com loads as an error on my WP multi-site netwo

  • Resolved ronpark10

    (@ronpark10)



    Hello,

    I’m running an up-to-date version of a WP multi-site network successfully (homepage and subdomains all work), with only one problem.

    My domain loads perfectly with the http://www., but when the www. isn’t preceding, it loads up to this page: http://www.domain.com/wp-signup.php?new=domain.com.

    I’ve never had this problem with WP before, so I’m looking for a way to fix this… Trying to make http://www.domain.com and domain.com load up the homepage fine, and be like my regular WP sites ending up in the address bar as http://www.domain.com/

    How can I achieve this? What must I edit?

    Thank you for your help in advance.

Viewing 15 replies - 1 through 15 (of 31 total)
  • Something similar bugs me too. I used to have 5 separate installs which handled the www thing just fine. Wheter somebody typed gangleri.nl/musicreviews or with www, the site loaded. Now musicreviews is a subsite in a multi install and when you do not type www in the subsite urls, the main site loads.

    What does this mean anyway?

    Update siteurl and home as well.

    It’s checked, I guess by default. It’s a setting in “network admin” for each of the subsites.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Roy – When you set up your site, it looks like you forced the www. in there (IIRC by default it’s not). It’s possible that’s causing a conflict.

    You could force a redirect via .htaccess

    # permanently redirect from non-www domain to www domain
    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^domain\.tld$ [NC]
    RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L]

    Ipstenu, sorry for the slow reaction. I couldn’t try earlier. The result is the same as without the code. gangleri.nl/filmreviews still reverts to the main site.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Check in yuor wp-config.php and see if you listed your site as gangleri.nl or http://www.gangleri.nl in the MultiSite section?

    Yes, but when I remove it, a non-www url gives an “error establishing database connection”. Or do you mean your htaccess code and no www in wp-config?
    I don’t want to discard the www btw, but I just noticed that in the multi setup not typing www doesn’t automatically redirect correctly.

    I see our half-elf online 🙂

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Yeah, but I don’t really have an answer for this one :/

    Somewhere in all this your site doesn’t KNOW that it’s supposed to be http://www.gangleri.nl and you may have to hunt around the DB and the wp-config.php to make sure everything lines up right.

    Also, since gangleri.nl/musicreviews is kicking you to http://www.gangleri.nl, something is really weird, and that is NOT a native feature of WP. WP would, at worst, show you a 404.

    I checked and saw I get a 302 redirect on the non www pages, which is even odder. You don’t have anything funky for redirects in plugins or your htaccess, do you?

    The funny thing is that it all worked just fine before I went from five single installs to a multi, so no, I never needed anything to redirect anything.
    Hm, a 302. Should I start looking at server settings rather than something in WP?

    Perhaps one thing to look into could perhaps be that I simply upgraded my 2.9.2 to 3.0 and then made a network out of it. Could it be that my htaccess would have looked different when I would have come from MU? I can’t access my htaccess from work, but I’ll check what it looks like when I’m home.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Could it be that my htaccess would have looked different when I would have come from MU?

    Oh certainly yes!

    Your new one should be

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Ok, I’ll compare this to what I have and let you know what’s what.

    Sorry, this was my first change to have a look at my htaccess.

    There actually is a difference between what you suggest and what I have. I have this:

    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]

    Changing it to what you suggest, does not make a difference though.

    For the rest, my htaccess contains
    AddHandler x-httpd-php5 .php
    To force my server to use PHP 5

    IP and referrer ban rules and

    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
    RewriteCond %{HTTP_REFERER} !.*gangleri.nl.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]

    Which comes from the Ask Apache plugin (I think).

    Does that give you any suggestions?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    What you have for the WordPress section is kind of HALF of what you should have had. Was that the WHOLE WordPress section? It does matter cause the top part is needed too AND if you didn’t update it when you moved off WPMU, it may be wrong.

    Sidenote:

    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
    RewriteCond %{HTTP_REFERER} !.*gangleri.nl.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]

    That section just says ‘If I come to the comment submition page without having actually come here FROM this site, then I’m back-dooring the comment and I’m a wicked spammer! Ggrrrr!’ I use it myself on my registration page. It’s fine, but you should change {REMOTE_ADDR} to something else. Like … a remote site 😉 Mine is http://lmgtfy.com/?q=spammer

    Yes I have the complete WP part, I only posted the part that differed. And no, I didn’t come from MU. I used to have 5 installs and when 3.0 came, I upgraded one to a network and deleted the rest.

    That rewrite part comes from some plugin I suppose (Ask Apache or one of the many anti spam plugins that I’ve been trying lately). Funny that they come up with half a code.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Turn off Ask Apache.

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘www.domain.com loads, but domain.com loads as an error on my WP multi-site netwo’ is closed to new replies.