Ticket #457 (new task)

Opened 9 months ago

Last modified 7 months ago

Domain Mapping Proposal

Reported by: ktlee Assigned to: somebody
Priority: normal Milestone: WPMU 2.0
Component: component1 Version: 2.0
Severity: normal Keywords:
Cc:

Description

Here is what I know for domain mapping on the WMPU, and most of this are from WPMU forum. Cheers.

Background Information

Two type of domain mapping.

1. Multiple MU Style WPMU acts like another installation of the WMPU but use the same core file. So one installation you can have many blogging community with unique domain name. Technically, it creates row in the wp-site table, and it has its own site admin, theme, site_usermeta etc. This is great, but it's cumbersome to those people who only want domain mapping on his/her blog. Moreover, this makes site admins life harder, since he/she will need to maintain the fields in the wp_site and wp_sitemeta table for individual custom domain. XD This leads to second type of domain mapping.

2. Specific Blog Domain Mapping

Basically, a blog maps to one domain name only. Ideally, we don't want wpmu to create additional site in wp_site table and the site_meta etc. Why? addition of theses fields will costs siteadmin too much hassle maintain. In additional, it will then be possible to provide an interface to your blog user to setup their domain by themself. (Like wordpress.com)

Procedure

Domain side setup - Tasks that doesn't involved WPMU

1. Domain DNS pointing to WPMU DNS

2. On the server side, setup the domain and DNS records. (Setup depends on your hosting control panel.) In short,

3. Create a folder for that domain.

4. Do a symbolic link to map your existing WMPU installation folder to the folder you just created.

WPMU Setup for "Multiple MU"

5. Install Multi site manager plugin.

6. Use that plugin to create a blog

7. That should be it for multiple MU.

WPMU Setup for "Specific Blog Domain Mapping"

5. Edit blog URL field to yourdomain url (5 edit in wp db*)

The problem arise because cookie will not get set properly. So you can't login, WMPU error no site defined etc.

Patch in the attachment will fix this problem. Basically, if a blog with no site defined will get site_id set to 1. And all the site_meta are same to the siteid=1. Most importantly, the cookie will get setup properly.

*This patch will not effect with "Multiple MU Solution", they can coexist in one WPMU installation.

To Do Tasks

1. Create an interface for people to enter their own domain name.

2. Properly setup the domain and keep the original subdomain name.

3. An automatic way to do "Domain side setup" (specificall step 1 and 2) since we can use php to create folders, and do symlink.

4. Include patch to core? subject to Donncha. There might be an other way to do this. =)

Conclusion

Right now, I can handle the first 2 tasks with two additional blog option namely, alternative domain, & alternative domain enable. I won't get into details, and you can think of another way to do this as well. =)

But I don't know how to achieve Todo Tasks 3. Without this, site admin will still need to setup domain mapping manually on per blog bases. XD

Possible approach - Adding DNS via command line?

So yeah, if we can overcome that issue, "Specific Blog Domain Mapping" will not be a problem on WMPU.

Suggestions, questions, critiques are all welcome. =)

Cheers,

kt

Attachments

domain-mapping.diff (1.2 kB) - added by ktlee on 10/20/07 10:32:25.
wpmu-settings.diff (1.2 kB) - added by ktlee on 10/20/07 10:32:40.

Change History

10/20/07 10:04:36 changed by ktlee

I edit the patch a little bit. I found an error, now it should be fine. This will only work on VHOST setting.

10/20/07 10:32:25 changed by ktlee

  • attachment domain-mapping.diff added.

10/20/07 10:32:40 changed by ktlee

  • attachment wpmu-settings.diff added.

11/07/07 03:24:36 changed by lunabyte

I can't see this a a viable core solution.

Create a directory and make sym links? Um, why?

Apache can easily be set up to serve any domain thrown at it from the same file path.

From there, php can work its magic.

11/26/07 19:34:55 changed by ktlee

I agree with you.

At this point I don't know how to setup that in Apache and php.

Can you tell us how would you do that?

I am looking for this as well.