📜 ⬆️ ⬇️

Wordpress 3 multiblog domain mapping

Recently, I really wanted to try the multiblog system in Wordpress 3.0. Having corrected wp-config.php according to the instructions and going into the site settings I found an interesting thing - multiblogs can be made only of two types:
1. example.com/sitename
2. sitename.example.com

Naturally I really wanted to do sitename.com. In the multiblog settings I made a variant with subdomains and decided to write a plugin. Searched for different filters, etc. to intercept the blog definition and remake a bit. As it turned out there are no such filters :(

Next go to Google. I found several plugins, but they didn’t quite what they wanted. One suggested a simple redirect from sitename.com to sitename.example.com. Another suggested using ServerAlias ​​in Apache settings. The third one is to start vhost with the same ServerAlias. Not fun :(

Kolupavshis a couple of hours, I found an interesting thing ...
Create a new site:


Go to the site management and select Edit for this site and see:


Change Domain to sitename.com, click Update Options and get our blog on sitename.com

PS Naturally the server and DocumentRoot for example.com and sitename.com should match. That, in principle, is provided by a simple mapping of the sitename.com domain to the ip-address of the example.com domain

PSS example.com = nd.local in my examples

PSSS Bug or feature? When will make the normal addition of domains, and not just subdomains?

Source: https://habr.com/ru/post/101124/

All Articles