The MU forums have moved to WordPress.org

Solution: Domain hosting (66 posts)

  1. drmike
    Member
    Posted 15 years ago #

    Does this still work for folks? I'm hasing an issue with the login into the additional domains that I'm trying to track down.

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/dariabe/public_html/wp-includes/wpmu-functions.php on line 218

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/dariabe/public_html/wp-includes/wpmu-functions.php on line 218

    Followed by the normal "Cant modify headers..." errors.

    I have to see where 218 is within my wpmu-functions.php file as, for me, that's probably the most modified file I have.

    edit: #218 is the check for site admins:

    if( in_array( $user_login, $site_admins ) )

  2. drmike
    Member
    Posted 15 years ago #

    Figured it out. Open up the wp_sitemeta table and dupe over the site_admins line from site #1 for each of those domains you're adding in while changing the siteid as you go.

  3. frozonecold
    Member
    Posted 15 years ago #

    Is there any way to achieve the redirect w/o having a huge .htaccess file?

  4. drmike
    Member
    Posted 15 years ago #

    You could just skip the redirect actually. You don't need it for a new blog placed in there actually since the previous site wasn't used. I just added two sites on my install and just skipped the redirects.

    You could create a new blog for the domain and just do a "Hey I've moved" on the old blog.

    After a few months, you could just remove the redirects as, if they still haven't been updated by then, they never will be.

    This article suggests moving the redirects to http.conf. That's an idea.

  5. frozonecold
    Member
    Posted 15 years ago #

    What about a simple javascript redirect? Would that work?

  6. drmike
    Member
    Posted 15 years ago #

    Not sure. You would have to figure out some way to call it that would be site specific. that would be the issue.

  7. helmi
    Member
    Posted 15 years ago #

    i wouldn't do any javascript redirection as search engines don't recognize them and you'll have a duplicate content problem afterwards.

    i just tried out this way to get a domain working on a single blog. It looks like it's working but it's kind of a silly way in some cases.

    let me explain my case: I need a backend for a network of blogs (a few hundret of them) filled by also a few hundred users. the users should not be allowed to register new blogs but they should be able to register (probably also for a bbpress conected). each blog will get it's own domain or even the most of them,

    In this case setting up a "site" for each blog is kinda hard and silly as i don't want to setup hosting for every domain but only one blog. setting up site, sitemeta and the blog-url changes are kind of a hard job and every change in sitemeta has been reproduced to all domains.

    What do you think?

    From the FAQ there should be a hidden multidomain feature ;)

    Does it support regular domains in addition to sub-domains?

    Sure, to MU a domain is just a domain. You can configure it to respond to any top-level domains or subdomains.

  8. drmike
    Member
    Posted 15 years ago #

    The setting up the site in the site table is the solution for the cookies and problems with loging in. What we usually suggest is just making a redirect in htaccess from the wp-signup.php page for the additional domain and point it to the signup page of the real hosting domain.

  9. selad
    Member
    Posted 15 years ago #

    I'm not sure how the htaccess will perform for a large number of rules.

  10. selad
    Member
    Posted 15 years ago #

    Another issue when you do redirects is that after you change the blog site_id the blog can be retaken on the original domain. One can restrict than from the admin options.

  11. drmike
    Member
    Posted 15 years ago #

    Another issue when you do redirects is that after you change the blog site_id the blog can be retaken on the original domain.

    Shouldn't as the htaccess redirect is applied first before the server gets down to mu.

  12. peiqinglong
    Member
    Posted 15 years ago #


  13. andrea_r
    Moderator
    Posted 15 years ago #

    "I'm not sure how the htaccess will perform for a large number of rules."

    Slowly. :) no, seriously - the htaces now included is something like 1/3 to 1/4 the size it was in very early versions.

  14. peiqinglong
    Member
    Posted 15 years ago #

    Ok, I'm having some slight issues. I was able to do drmike's method and it works perfectly. Here are the snags I'm running into:

    1. When I delete a page from one of the parked domain sites, it doesn't stay deleted. Like it looks like it deletes fine, but when I refresh, it reappears. I'm deleting from the Manage area
    2. When a user, who has cross permissions on the main site and also one of the parked domain sites, the user has to relogin in if they were logged to the main site and try to access the parked domain. (I'm thinking this might be a cookie issue or something similar because for the parked domain thing to work, I have to go to the database and under wp_blogs change the site_id to match the blog_id. Wondering if there is a way around this?)
    3. With a new parked domain with it's own blog_id and same site_id, I can't create a subdomain off the parked domain. I get a redirect to the main Mu install trying to create it under the main Mu install rather than under the parked domain.

    Other than that, this is great! Thanks drmike!

  15. zappoman
    Member
    Posted 15 years ago #

    I am looking at a similar/related problem.

    I have several blogs (let's say 100, so hand editing these settings is a pain)... I'm using vhost style. I want to test a "pre-production" environment hosted on a different domain.

    Say my normal domain is domain.tld, and the blogs are all at "blog1.domain.tld" "blog2.domain.tld" etc...

    And I want to copy over the config into a mirror environment at the domain "domain2.tld"...

    It seems like some fiddling with this sites table should do the trick. I'd even be willing to hack some of the code in wpmu-settings.php.

    Thoughts?

  16. nims
    Member
    Posted 15 years ago #

    Any new development on this Mike ?
    My host doesnt allow wildcard DNS so
    1. Should I still install WPMU with sub-domain option to use this method.
    2. Should I use sub-directory structure and apply this method ?

  17. andrea_r
    Moderator
    Posted 15 years ago #

    Use the subdir method, otherwise it just won't even work.

  18. drmike
    Member
    Posted 15 years ago #

    Nothing to develop. It works.

    It won't work with the subdirectories though. If your host doesn't allow wildcard dns, then that's something you need to deal with. Gotta admit that I would be moving hosts as they're probably not going to like having wpmu on their boxes.

  19. nims
    Member
    Posted 15 years ago #

    Thanks Mice. Let me look for a better host then. :)

  20. StianH
    Member
    Posted 15 years ago #

    After a little back and forth I was able to start loggin into blogs on other domains. I have a couple of issues though.

    The thing is that I am moving about 20 blogs from one install to another. All those blogs are have subdomains on the same domain, is it possible to just add one setting to wp_site?

    Also, when going to olddomain.com/wp-admin/ I can log in fine with both admin and the user with access, but with the admin user I don't get the admin menu.

    I'm currently only having moved one blog/domain as a test, but I think this would apply to any blog I import, or change the site_id for. When logging in as the admin user to the regular domain I of course get the administration, and there I can list all blogs, except the one with a different site_id.

    Any ideas on how to remedy this? Since I won't get access to the admin area when logging in through the old domain, and the old blogs aren't listed in the admin area on the new domain, that leaves me stranded in regards of doing administrative tasks :/

  21. Trent
    Member
    Posted 14 years ago #

    I am having a few issues getting this accomplished on dreamhost. Anyone have any pointers on getting a new domain parked on the wpmu domain? I think it must be an easy thing, but I just can't seem to figure it out! Any help would be appreciated!

    Trent

  22. Trent
    Member
    Posted 14 years ago #

    In case anyone cares, I figured it out ;) I just created the domain as a fully hosted domain and put it on the same path as the original wpmu domain. Then using the Site Manager Plugin I created the domain and just cloned all the settings from the original wpmu (there is an option to do so in the plugin).

    What was throwing me off was the site path. It wouldn't work for me and I figured out by reading around that it will not work unless you have the "/" in that option. Of course, it was that little character that stumped me and didn't have this working for 3 days, but reading documentation sometimes helps:)

    Trent

  23. andrea_r
    Moderator
    Posted 14 years ago #

    Although I found it worked for a small number of domains, I ran into issues when I added more than a handful. Let me know if you run into the same problems.

  24. Trent
    Member
    Posted 14 years ago #

    What kind of problems did you find? I have 8 domains only right now and it seems to be working fine. That is a small number I guess.

    Trent

  25. andrea_r
    Moderator
    Posted 14 years ago #

    When I cloned the site and added another one, site admins didn't have admin permissions on the newly created site. And yes, it was done correctly. :) I spent way too much time trying to figure it out and had to scale back. But I'll have to revisit this again, because it part of the overall plan for this particular site. (Each blog will have its own domain, but still be part of the network. There will be dozens upon dozens.)

  26. lunabyte
    Member
    Posted 14 years ago #

    "Each blog will have its own domain, but still be part of the network."

    Have fun keeping users logged in across domains.

    It can be done, but it will take some work.

  27. andrea_r
    Moderator
    Posted 14 years ago #

    Yeah, I know. :-/

    Keeping users logged isn't an issue for this project, as the admin for one blog won't need to be logged in to another. just site admins.

    (I can fill you in later.)

  28. NoReason
    Member
    Posted 14 years ago #

    Is it possible to do this with the subdirectory structure?

  29. Trent
    Member
    Posted 14 years ago #

    It would actually be nice to have the domain mapping work on top of the subdomain off the main WPMU install so all the backend is still on the main domain. I have read loads of articles and threads and it looks like domain mapping has to be done with moving the blog to the new domain in the wp_sites directory. Anyone got a clue how this could be reversed and still have the backend admin area with:

    http://subdomain.domain1.com/wp-admin/

    with domain1.com being the main WPMU domain but still have traffic go to:

    http://domain2.com

    It would solve a few issues that I am dealing with and I can't seem to get my head around how it could be done. Obviously it can since wordpress.com is setup this way, but current domain mapping through drmike's method or the multi-site manager plugin do not.

    Thoughts?

    Trent

  30. bikerjeg
    Member
    Posted 14 years ago #

    Has anyone here tried the integration with the database modifications explained here: http://bui4ever.com/web-itecture/wordpress_mu_with_domain_mapping?

    I did everything as described and was successful with the integration except that now I can't upload files through the TLD blogs setup in MU. I get an error:

    Warning: Invalid argument supplied for foreach() in /home/sitename/public_html/wp-includes/functions.php on line 1122

    does anyone have a resolution for this issue? I have been searching everywhere without any real answers

About this Topic