Monday, June 23, 2014

Wordpress Multisite - Using a custom domain for a blog

In Wordpress Multisite, when you create a blog (site), the blog's url will be something like:

http://my.domain.com/mysite1

and another blog:

http://my.domain.com/mysite2


What if you want to use my.awesome.domain for mysite1?


1. Point my.awesome.domain to the IP address of your blog server

2. Login to MySQL database of your blog, change the domain & path fields of the mysite1 blog to "my.awesome.domain" and path to "/" (table wp_blogs)

* Get blog_id of mysite1 (the latest one)

SELECT * FROM table ORDER BY id DESC LIMIT 1;

* Update domain & path fields of mysite1:

UPDATE wp_blogs SET domain='my.awesome.domain', path='/' WHERE blog_id = <get from above query>;


Now, you can access your new blog mysite1 using this url: http://my.awesome.domain



References: http://codex.wordpress.org/Database_Description#Multisite_Table_Overview