WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] I need help getting multisite to work! (31 posts)

  1. sjbenson
    Member
    Posted 2 years ago #

    I am in way over my head.

    I have used WordPress for other projects. I offered to finish my aunt's sites for her, because whoever had started working on them had failed to finish the project.

    What I did not know:
    She had a single ip address and all domains registered were aliased to the main domain.
    The previous main domain had been canceled and one of the aliased domains reverted to the main.
    When she re-instituted the domain and we made it the primary domain, it removed her other blog. I never backed it up properly because I did not know that was how it was going to happen. I have copies of the mysql, and most of the old files still seem to be there.

    I have literally been doing this for weeks in my spare time. For the longest time I could not get the redirects to go where I wanted them to go. Then I learned about a mult-sites and realized that it looked like the previous person had probably been trying to set that up.

    I enabled the multi-site. With some work I was able to get the aliased domain to redirect to a subdomain of the main domain that I wanted to use. However, despite going through everything I could find, I can't seem to get anything besides a 500 internal server error when I try to use the other domain. The main is fine.

    I know all of this is vague and I'm sure that my answer is somewhere in this forum, but I've been searching and I've just realized that I'm still too much of a noob at this. If anyone can give me any advice it would be much appreciated. I apologize in advance for being totally ignorant.

  2. That;s okay :)

    First, before we jump into domain mapping, does Multisite work in and of itself? That is, WITHOUT mapping anything, can you make a subsite and have it work?

  3. sjbenson
    Member
    Posted 2 years ago #

    No, when I created the subdomain it did not work.

    Thank you for your help!

  4. sjbenson
    Member
    Posted 2 years ago #

    Sorry for the slow reply, I've been working and sleeping for the past 20 hours.

  5. S'okay, we're all volunteers here :)

    Okay, let's work on the Subdomain first.

    Check your .htaccess. Make SURE it's the right one. Go to yourdomain.com/wp-admin/network/setup.php and match the .htacces there to what you have. Remember, you're replacing the old WP stuff :)

    If that looks fine, what error are you getting on the subdomain site? Is it also an error 500?

  6. sjbenson
    Member
    Posted 2 years ago #

    The main domain is working, to clarify. It's only the subdomain that is getting the 500 error.

    So I want the .htaccess in the root to match the one in wp-admin/network/setup.php? Okay, I'll take a look

  7. sjbenson
    Member
    Posted 2 years ago #

    So to clarify, do I need to insert this into the root .htaccess?

    require_once( './admin.php' );

    if ( ! is_multisite() )
    wp_die( __( 'Multisite support is not enabled.' ) );

    require( '../network.php' );

  8. sjbenson
    Member
    Posted 2 years ago #

    Inserting the text didn't work, I think maybe I'm misunderstanding you. Here is the .htaaccess in the root. I changed the identifiable stuff so that my aunt's business info is protected.

    rewriteengine on
    rewritecond %{HTTP_HOST} ^www.mydomain2.com$ [OR]
    rewritecond %{HTTP_HOST} ^mydomain2.com$
    rewriterule ^ "http\:\/\/subdomain\.mydomain1.net\.net\/subdomain" [R=301,L] #4f9b2a2587d02
    
    #uploaded files
    # add a trailing slash to /wp-admin
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    # BEGIN WordPress
    RewriteBase /
    # uploaded files
    # END WordPress
    # BEGIN WordPress
    
    rewriterule ^index\.php$ - [L]
    rewriterule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    rewritecond %{REQUEST_FILENAME} -f [OR]
    rewritecond %{REQUEST_FILENAME} -d
    rewriterule ^ - [L]
    rewriterule . index.php [L]
    rewriterule ^(.*/)?files/$ index.php [L]
    rewritecond %{REQUEST_URI} !.*wp-content/plugins.*
    rewriterule ^(.*/)?files/(.*) wp-content/ms-files.php?file=$2 [L]
    rewritecond %{REQUEST_URI} ^.*/wp-admin$
    rewriterule ^(.+)$ $1/ [R=301,L]
    rewritecond %{REQUEST_FILENAME} -f [OR]
    rewritecond %{REQUEST_FILENAME} -d
    rewriterule . - [L]
    rewriterule . index.php [L]
    rewriterule ^index\.php$ - [L]
    rewritecond %{REQUEST_FILENAME} !-f
    rewritecond %{REQUEST_FILENAME} !-d
    rewriterule . /index.php [L]
    
    # END WordPress

    I think there are some leftovers from the previous wp installation... does this look at all right?

  9. When I said go to yourdomain.com/wp-admin/network/setup.php what I mean was ... you know, http://yourdomain.com/wp-admin/network/setup.php

    (When we tell you to look at the files, we'll say /wp-admin/network.... etc ;) )

    And yeah, your .htaccess is screwed up. S'okay! We can fix. Are you using subdomains or subfolders?

  10. sjbenson
    Member
    Posted 2 years ago #

    Sorry, my brain is fried from looking at this too long.

    Okay, so I'm working with subdomains.

    I replaced this:

    rewriterule ^index\.php$ - [L]
    rewriterule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    rewritecond %{REQUEST_FILENAME} -f [OR]
    rewritecond %{REQUEST_FILENAME} -d
    rewriterule ^ - [L]
    rewriterule . index.php [L]
    rewriterule ^(.*/)?files/$ index.php [L]
    rewritecond %{REQUEST_URI} !.*wp-content/plugins.*
    rewriterule ^(.*/)?files/(.*) wp-content/ms-files.php?file=$2 [L]
    rewritecond %{REQUEST_URI} ^.*/wp-admin$
    rewriterule ^(.+)$ $1/ [R=301,L]
    rewritecond %{REQUEST_FILENAME} -f [OR]
    rewritecond %{REQUEST_FILENAME} -d
    rewriterule . - [L]
    rewriterule . index.php [L]
    rewriterule ^index\.php$ - [L]
    rewritecond %{REQUEST_FILENAME} !-f
    rewritecond %{REQUEST_FILENAME} !-d
    rewriterule . /index.php [L]

    with:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    Didn't fix the problem, but it still seems to be working as well as it was previously... so that's good.

  11. sjbenson
    Member
    Posted 2 years ago #

    Um... let me rephrase that--I THINK I replaced it. I'm not using my computer and trying to read the .htaccess with notepad was getting me nowhere fast. Will double check when I'm back on my owm comp.

  12. You can't (easily) read it in notepad. It's a hidden file and sometimes Windows is teh stupiz.

    You should do this:

    rewriteengine on
    rewritecond %{HTTP_HOST} ^www.mydomain2.com$ [OR]
    rewritecond %{HTTP_HOST} ^mydomain2.com$
    rewriterule ^ "http\:\/\/subdomain\.mydomain1.net\.net\/subdomain" [R=301,L] 
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    </IfModule>

    I don't know about that top rewrite, honestly. But if you think you need it, okay. We MAY want to remove it for now to test.

  13. sjbenson
    Member
    Posted 2 years ago #

    I tried it both ways--I commented out the top rewrite. Either way, I'm now getting a 404 error instead.

    The top rewrite was inserted by the provider when I told the web interface to redirect one domain to that subdomain. Eventually I want to hide that it's redirected to a sub, but that's unimportant for the moment. Main thing is getting it running, LOL!

    I was about to tell you that the subdomain does exist. And then I logged into the domain manager and saw that they'd redone their whole site and now I can't find any of the subs or the aliased domains. So... that might be a problem.

    rewriteengine on
    rewritecond %{HTTP_HOST} ^www.mydomain2.com$ [OR]
    rewritecond %{HTTP_HOST} ^mydomain2.com$
    rewriterule ^ "http\:\/\/subdomain\.mydomain1.net\.net\/subdomain [R=301,L] 
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    </IfModule>
  14. sjbenson
    Member
    Posted 2 years ago #

    Hmmm... nevermind. There it is. The subdomain exists... don't know why it only shows up in one section and not the other. Anyhow, still getting 404 errors at the moment...

    I tried accessing the subdomain like this: subdomain.maindomain.net instead of subdomain.maindomain.net/subdomain and I get a 403 forbidden error as well.

  15. The subdomain ... exists?

    You mean you made the subdomain manually and not via wildcards?

  16. sjbenson
    Member
    Posted 2 years ago #

    well... yeah... was that my mistake? I did it through the host's web interface.

    I can easily delete it.

    Update: just for the heck of it, I removed the entry from the host's web host manager. Didn't change a thing.

    LOL, I told you I was in over my head... every other project I've worked on was just small code tweaks and each of the sites had their own ftp roots. I'm a tad ignorant... and, yeah, I know I need to learn more before trying stuff like this, but I had no idea I'd be doing anything but tweaking the theme code for her. But apparently I'm not the first one to have this problem while dealing with this project... the last person gave up several years ago.

  17. If you add a subdomain MANUALLY you need to make sure it points to the document root (i.e. where you installed WP). By default, a subdomain makes it's OWN folder on the server, you see, and runs out of /public_html/subdomain/

    We don't want that. We want the subdomains to run out of /public_html/ and ONLY that.

    So if you make a MANUAL subdomain, you must make sure it points there, and not it's own folder.

    If you make a wildcard, it too has to point to the /public_html/ folder :)

    If all that is too much a pain, can you use SubFOLDER sites instead? You can map domains to them just fine.

  18. sjbenson
    Member
    Posted 2 years ago #

    okay... will try that. Thank you for your time and patience. I will update my results as soon as I've given that a shot.

  19. sjbenson
    Member
    Posted 2 years ago #

    I think I will try to reinstall and do subfolders instead. That seems less... confusing. I will learn all the rewrite rules but if mapping the domain to a subfolder works just as well... will update.

  20. Yep, totally works just as well :) And yes, it's MUCH easier than subdomains (AND more supported by hosts - not all support wildcard subdomains, or subdomains at all. Because apparently it's still 1999)

  21. sjbenson
    Member
    Posted 2 years ago #

    Ah, halleluiah! I have access to the second site finally!

    LOL!

    Okay, now, I don't know if you can help show me how to map the aliased domain to the site?

    All I did was change the wp-config.php line

    define( 'SUBDOMAIN_INSTALL', false );

    from true to false. Now, even with my redirect rules in place, it doesn't seem to be sending the domain where I want it to go. I uncommented my redirect rules but that didn't really change anything.

    At least I can start setting the second site up in the mean time, anyway.

    Edit: I had re-inserted the subdomain at the hosting control panel before I changed the wp-config.php--long story. The second site is pointing at the subdomain now. Why would that be if I've deactivated subdomain in multi-site? LOL!

    Edit again: I finally located the dns manager for the second domain. Should I edit any CNAME entries to make this map correctly?

  22. Now that you have the subsite working, you need to install http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

    :) That's why I said 'Get WP working, THEN deal with mapping.'

  23. sjbenson
    Member
    Posted 2 years ago #

    Did that already. :-) Hopefully correctly, lol! I have the plugin activated and it has domain mapping as an option in my network admin.

    I added the domain. I removed all the redirects I could find on .htaccess just to start it from scratch. I tried to make sure there were no more references in the mainsite zone to confuse the second site zone in the DNS Manager. I used the ftp method for the domain, but it doesn't appear to be working. I have no idea how to make the cName method work... still looking at it but I think I'm just confusing myself.

    Edit: on the mainsite zone I removed an aname entry that I think created the subdomain, because now it's not working again. Will reinsert, hopefully it doesn't take too long to propagate.

  24. sjbenson
    Member
    Posted 2 years ago #

    Okay, reinserted it. Now we're up and running again. Still can't get the second domain to point at the second blogsite, but at least it's something, lol!

  25. sjbenson
    Member
    Posted 2 years ago #

    So... I don't know if this is actually the problem or not, but I noticed that when I enter the second domain, the one I want to redirect, it actually seems to be sending me to a specific folder that doesn't have anything on it. So should I be putting a .php file in that folder to send it back to the root? Maybe that's what I've been missing all along?

  26. Do you know how to park a domain? Really, all you need to do in most situations is point the new domain to your DNS server, and then park the new domain right on top of the old one. They're both going to point to the same place, and let WP sort it out.

  27. sjbenson
    Member
    Posted 2 years ago #

    In the DNs zone editor it lists two DNS entries for each of the domains. Should I change the one to match the other then? They basically are the same except for the end which is numerical, 49 and 50 for one and 51-52 for the other.

  28. I want to say yes, but I think you should screenshot that and link to it to be sure.

    If those are the IP addresses, then yes, they should all point to where the working site is.

    If you're still having trouble mapping a domain to the server (and please understand, this is OUTSIDE of WordPress, you have WP working, you have subsites, now you're trying to point a domain to the same server where WP is installed), you can ask your host how they suggest you park one domain on top of another.

  29. sjbenson
    Member
    Posted 2 years ago #

    Lol, no, I do get that much (about WP being separate.)

    The aName for both sites is pointing to the same ip address (this much I checked repeatedly.) The DNS nameservers was what I was referring to. I sent the last post from my iphone.

    I'm going to go through the host's documentation to see if I can figure that out. Contacting the host is a bit difficult since I'll have to do it through my aunt... doable, but a pain in the @$$.

  30. sjbenson
    Member
    Posted 2 years ago #

    P.S. Thank you so much for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.