The MU forums have moved to WordPress.org

1 2 3

Solution: Domain hosting (66 posts)

  1. drmike
    Member
    Posted 17 years ago #

    Greets:

    Boy, wouldn't this be funny if putting a domain hosting for a blog was like the easiest thing we've ever done? I mean like 4 edits and you had it. Boy, that would be really funny. We'd look like bloody idiots and have such a good chuckle over it.

    :)

    Working on the walkthru.

  2. drmike
    Member
    Posted 17 years ago #

    WPMu domain; http://cynix.us

    Blog within WPMu setup: http://test.cynix.us

    Requested domain example: http://drmike.uni.cc

    What's really funny is I've been thinking about this backwards. Take the requested domain and forward it to the WPMu URL. It works the other way.

    - Point the requested domain to the nameservers of the WPMu domain. (Ex: tell the registar for drmike.uni.cc to look at ns1 and ns2.tdjc.be. Those are cynix.us's servers.)

    - Park (not addon, not host. Park) the requested domain within the account of the WPMu account. For example, I go into the CPanel backend for cynix.us. CPanel -> Manage Parked Domains -> New Domain Name -> Add in the requested domain.

    - WPMu time. Open up Dashboard -> Site Admin -> Search for the blog within the WPMu setup and edit it. Look through that page. On my very basic setup at cynix.us, I see the URL of the blog listed 4 times. Edit those four occurances from the old URL to the new one. If it has the 'http:// in there, keep it in there. Click on Save changes.

    The setup should now work.

    One last bit. If you want to old URL to point to the new one as well, you have to setup a redirect within the .htaccess file within teh root of your WPMu install. For example:


    RewriteCond %{HTTP_HOST} ^test.cynix.us$ [OR]
    RewriteCond %{HTTP_HOST} ^www.test.cynix.us$
    RewriteRule ^(.*)$ http://drmike.uni.cc/$1 [R=301,L]

    Hope this helps,
    -drmike

  3. andrea_r
    Moderator
    Posted 17 years ago #

    Ilike you, drmike. have I ever said that? boy, we'd have some good chuckles over coffee. :D

  4. andrewbillits
    Member
    Posted 17 years ago #

    hmm, never thought of doing it that way. I wonder if this would work with several hundred or just a few blogs.

  5. drmike
    Member
    Posted 17 years ago #

    Just done it on the test of one with a near empty install.

    Like I said, it seems backwards to me but try those links. Works as far as I can tell.

    It would make for a fairly long htaccess file though if you more than just a few. In the back of my mind, that's a bad thing but I can't prove that right off. I know I try to keep that file under 30 lines. It loads every time a page does IIRC.

  6. selad
    Member
    Posted 17 years ago #

    drmike this is great!

    We have applied your suggestions (including the redirect within the .htaccess) but we have two problems:
    1) we can't login to the blog. the redirect rule seems not to work.
    2) we get 404 errors for the archives and catagories.

    Any idea what might be wrong?

  7. drmike
    Member
    Posted 17 years ago #

    I had the 404 issue come up with posts but after reloading the browser, it went away. Not sure what the issue was but I note I can flip through my own test blog without any issue from both category links within the posts and the sidebar.

    Didn't know about the login issue. That's probably a stopper. I note that when I try to login into the backend with the admin information, it doesn't even give me an error. IIRC, that was a sign of the cookie not being recognized.

    I wonder if we could get Donncha to see about this if we tell him that this is a much requested feature and one long saught after. :)

  8. drmike
    Member
    Posted 17 years ago #

    Solved the cookie issue. It's discussed in this thread. I must have missed it when I was ringing the bell.

    - Add in the site to the wp_site table as a new record. For me, since this was a near empty install, site_id was 2, domain was drmike.uni.cc, and path was /

    - Go back and edit the site record within wp_blogs and change the site_id to the new one. In this case: 2.

    Does this work any better for your folks? I just logged on into the back end of the blog in question with my admin ID and it worked fine. I can even see the Site Admin pages.

    I need to see if this works with a regular admin account for the blog but it should.

    So what else did I miss while I was gone? :)

  9. selad
    Member
    Posted 17 years ago #

    That did solve the login problem - thanks!

    But we still have the 404 errors. Reloading the browser or clearing the cache did not help :(

    Any ideas?

    PS - I can see pages with no problems.

  10. drmike
    Member
    Posted 17 years ago #

    I'm at a lost to be honest. When I first did it, I got it the first time though but it was fine after I reloaded the blog. The test is still up there if you want to poke around. Maybe you'll see something on it that I'm not but it works for me.

    Care to post your link? The archives and categories work on mine. Maybe I'll see something on your and it will click.

  11. selad
    Member
    Posted 17 years ago #

    I just deleted the permalinks and it is fine now with the default ones.

    Another issue is how do you block this:
    http://drmike.uni.cc/wp-signup.php

    And did you copy the wp_sitemeta enteries?

  12. lunabyte
    Member
    Posted 17 years ago #

    I haven't played with this yet, but something isn't making sense to me here.

    Why could one just do the following:

    a) add another alias to the virtual host. (like park the domain on the account in cPanel, for you cPanel folks)

    b) add the domain to the sites table.

    c) add a blog which uses that domain.

    Seems like that would work, to me.

    With the weekend coming up, I just might try that out.

  13. drmike
    Member
    Posted 17 years ago #

    You're doing it from a brand new blog point of view. My explaination is for a blog that's already in the site. Should work though.

    Selad, just do a htaccess redirect to the signup page for the real site if someone tries to access that page.

  14. selad
    Member
    Posted 17 years ago #

    The problems I had with the 404 error and the default permalinks was solved by exporting all posts and then importing them back - I have no idea why this works.

  15. drmike
    Member
    Posted 17 years ago #

    Strange. Next time it happens, try making a change to the permalink structure, running the update, and changing it back. See if that helps.

    IIRC, the URLs are stored within the tables but it's the URls without the domain URL so that shouldn't matter.

  16. selad
    Member
    Posted 17 years ago #

    Do you mean running wpmu-upgrade-site.php?

    It might be an issue with the guid?

  17. drmike
    Member
    Posted 17 years ago #

    No, go into the individual blog's back end at Dashboard -> Options -> Permalink.

    I'm thinking the guid (That's what you have to change within that plugin to make the tag system work.) but the guid doesn't include the domain name bit. Just like from the year to the right of the URL.

  18. selad
    Member
    Posted 17 years ago #

    I have already tried the permalinks update with no luck.

    The guid holds the full path including the domain - you can see it in the wp_XXX_posts table (XXX = blog id).

  19. drmike
    Member
    Posted 17 years ago #

    Gone to look.

    That's strange that you're having such an issue as I made sure I gave it content first before I tried it. I have a series of dummy posts that I import into our theme demo blogs and I just uploaded though.

    Actually I'm getting confused here between the guid table which does have the domain URL and the post-name which doesn't.

    Are you sure you won't post a link to show this? You can email me if you want. Gotta admit that I'm curious as to why it works on my own site but not yours.

  20. selad
    Member
    Posted 17 years ago #

    drmike - sent you a message via your contact form.

  21. bradmkjr
    Blocked
    Posted 17 years ago #

    Would it be possible to set the "full" domain as an alias for the "blog" domain?

  22. pumpkinslayer
    Member
    Posted 17 years ago #

    Thank You DrMike

    All working, just as promised. But no login via the custom domain name (only directly through the wpmu blog site)

    I imagine it would be possible to have a complete other site hosted with all the same software, like blogsite1.com and blogsite2.com both running off the same code. I think those wordpress people have most likely made it that way.

    I think many of the options that are in my tables are a legacy of an old install, I suspect there is much duplication where there needn't be.

    I'm sifting through the global tables to find references to the original main blog and replicate those options onto the new blog for the second site.

    More news when I have a chance to play.

  23. pumpkinslayer
    Member
    Posted 17 years ago #

    Changed the entry in the wp_blogs table to match the new site_id for the new site and I managed to sign up for a new blog on the new domain.

    However... the catchall subdomains need to be activated for this site too.

    Secondly... the new blog is still marked with the original site's site_id, which I think is probably hardcoded in wp-signup.php

    So... HAPPY, it does sign up the new blog, with completely distinct domain name. Multiple MUs (potentialy)

    Many, many praises to the wordpress crew who have thrown together this package, fantastic...

    So, a question: How do you make a login into the new domain without making it a complete new mu site (where people can signup for their own)?

  24. drmike
    Member
    Posted 17 years ago #

    Selad, just do a htaccess redirect towards the page you want them to signup on. Sorry that I didn't get back to you.

    Pump, not sure what yu're asking here.

  25. pumpkinslayer
    Member
    Posted 17 years ago #

    In order to make multi mu sites work there are hardcoded references in wpmu-functions.php to be removed.

    These are all like "$site_id = 1" and the calls for them leave out this parameter. As a hint, I've only fiddled so far, put in "global $current_site;" into the function and get the $site_id from $current_site->id which returns the current site id. Look in wp-signup.php and /wp-includes/wpmu-functions.php for the changes.

    I had to add an if statement to wp-signup so you can't signup for blogs from the new site.

  26. Ovidiu
    Member
    Posted 17 years ago #

    @drmike

    can you give me a hint how I would go ahead if I wanted one subdomain of my mu install to just show a static page aka a normal site served out of a folder in my main domain?

    aka have test.mydomain.com be served from mydomain.com/test/ instead of being treated like a blog on the mydomain.com?

    can I solve this by using DNS and apache entries? is anything involved on the wpmu site to make an excemption for test.... ? or will wpmu just not pick it up if it has a separate DNS entry pointing to the same site into this test folder?

  27. kingler
    Member
    Posted 17 years ago #

    I noticed a while ago that the domain mapping on wordpress.com has the theme CSS files served from username.wordpress.com, if you look at the HTML page source.

    But apparently now they have changed that. Try some of the blogs on this page and see for yourself.

    http://wordpress.com/blog/2006/07/30/domain-mapping-testers/

    I have tested domain mapping myself, using reverse proxy method, which is easier for me and requires very simple database changes. The only problem with that is the backend login has to be the original style like user.wordpress.com/wp-admin, not domain.com/wp-admin

  28. Rubyducky
    Member
    Posted 17 years ago #

    drmike,
    I don't have cpanel, so I can't park the domain that way and don't know another method that achieves the same results. Is there any other way I can do that step? Thanks!

  29. drmike
    Member
    Posted 17 years ago #

    ruby, what hosting platform do you have?

  30. Rubyducky
    Member
    Posted 17 years ago #

    I'm my own host with full access to the server

1 2 3

About this Topic