How to redirect a wordpress multisite to a particular blog?
One of my client who has a wordpress multisite application developed by me made a request that she wants to redirect the site to a particular blog due to some reason. FYI, wordpress in multisite mode allows you to set up multiple blogs under the same installation and manage all of them via network administrator(s).
I thought it will good to write a post about the steps one needs to take to achieve this.
- Log in to wp admin panel and make sure you have all the rights (superuser or network administrator).
- Select Network Admin => Sites and edit the site you would like to redirect to when say www.abc.com is requested in the browser. Change it’s path to ‘/’ and make sure that the checkbox that says Update siteurl and home as well is checked. Also make sure the domain is set correctly without any subdomain or subfolder path. Click save button.
- Look for the following code below in wp-config.php file and modify the number that is the ‘ID’ of the blog you would like to appear when the URL above is requested. In my case, it was number 3, so, the code statement looked like:
- Select Network Admin => Sites and edit the site that you don’t want to appear as default site anymore. Change it’s path to a relevant subfolder e.g. ‘/movies/’. Make sure the update checkbox is checked similar to point 2 above. Click save button.
If you follow the steps above carefully, you will get the expected result as I followed them and gave a maintenance service to my client.