After a bit of tinkering I have gotten WordPress multisite to work on a HostGator server setup. I am running WordPress 3.0 RC3.
After some simple editing on the wp-config.php file and the .htaccess file I added a wildcard DNS by adding a subdomain with just an asterix * and that allows WordPress to create the subdomains for multisite. Here is how to get it to work…
Step 1
Login to cPanel (something like .com/cpanel ) Go to subdomains and add one with just an asterix.
Step 2
Add this into wp-config.php to enable multisite.
define('WP_ALLOW_MULTISITE', true);
Step 3
Login to your WordPress dashboard and go to Tools>>Network (.com/wp-admin/network.php) You will then see the following type of instructions.
Step 4
Add a directory named blogs.dir to the wp-content directory. It should look like /public_html/wp-content/blogs.dir
The CHMOD write permissions should be something like 755 to allow the server to write to the directory.
Step 5
Add what they tell you to add into the wp-config.php file
Mine looked like this:
define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', true ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'limecuda.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );
Make sure that SUBDOMAIN_INSTALL is set at true.
Step 6
Add what they tell you to add into the .htaccess file.
Mine looked like this:
RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L]
Step 7
I don’t know. Go start adding some sites on to your install. :)
Any questions?
Todd Lohenry says
I’ve done all this, but I’m not having any luck mapping domains to the ‘child’ sites I create. Any input?
Poor Uncle says
I have a “baby plan” with Hostgator. I created a main domain (the name that created the Hostgator account), plus 10 “add-on” domains, and installed WordPress on each of them. I point my godaddy domains to Hostgator’s name servers (DNS), and I am in business.
Now, instead of installing wordpress to each of my 11 websites. I only want to install it to the main one, and then enabling wordpress multisite to manage all of them.
My question: Do I need to remove (undo) the 10 “add-on” domains before I attempt to enabling wordpress multisite?
Blake Imeson says
Yes, you should remove them and then you will need to add a * as a subdomain to act as the wildcard for WordPress to create those sites.
Ronnie says
Hi,
I have a dedi server with Hostgator. I have done all the steps as above. The site descargarpelicula.net resolves fine…but then after sometime just stops, and is only accessable via descargarpelicula.clickmember.net
If I delete the addon domain for descargarepelica.net it works for about 2 hours and then stops. When I add the “addon” domain back it works again…but also for about 2 hours.
Whats going on?
Thanks for the info!
p.s. the image at Step 1 isn’t working…
Blake Imeson says
I would get on live chat with HostGator and see what they tell you. That is very buggy.
Thanks for the heads-up on the image. I seem to have just lost a bunch of images inexplicably :(
Ewergren says
Which HostGator plan are you using? Will this work on hatchling or baby?
Ewergren says
Oh and that image is still not working.
Blake Imeson says
@Ewergren I have a reseller account with them but any of their plans should do this.
I also replace the image. Thanks.
Paulo says
Blake, I also have a reseller account with them, and I’m trying to set up multisite on a domain (not the account domain). Why wouldn’t it work?
Michael says
In hostgator’s baby plan, when an addon domain is created using the cPanel, cPanel automatically also creates a subdomain (addondomain.primarydomain.com) in addition to the independent addondomain.com, (it looks like the extra subdomain ie. addondomain.primarydomain.com just to function like to ‘bridge’ user access to the addon domain that located at the root of the primary domain public_html but as an independent domain), so, if I install ‘WP 3.0 multisite’ on my primary site and another independent ‘single WP 3.0’ on my addon domain site, while when I follow above, I also would have an (asterix)*.primarydomain.com subdomain, will both my multisite WP installed on my primarydomain.com and it related virtual subdomain sites, and independent single WP on my addondomain.com function well? And the (asterix) *.primarydomain.com will not harm/mess up the single independent WP 3.0 installed on my addondomain.com ?
Blake Imeson says
@Michael that sounds pretty complicated and I don’t know offhand without testing. I would imagine it would be fine as long as one of the subdomains created by multisite isn’t named the same as the addon domain. If this is a potential issue then when cPanel is creating the subdomain/directory that foes in the root I would suggest adding some random characters into it.
Tore says
I had the same problem. I first tried installing wordpress network on an addon domain but I couldn’t get it to work. So i tried it using the primary domain and it worked.
Having a network on the primarydomain, using a *.primarydomain.com wildcard won’t affect your regular blogs (or sites) that are added in hostgator.
shawn sandy says
Note: When creating the wildcard subdomain for addon domains STEP 1. you need to add the correct document root path
eg: public_html/yoursubdomain.com/
Sharon says
I just started using Multisite today. I am having issues creating new sites. It creates some of them, like “test.mydomain.com” but not others (for example, “testblog.mydomain.com”). I removed the banned signup words, so I don’t know what is preventing any site I create from working. All it shows is a “Problem loading page” error (in Firefox) for certain domains I try to make. Do you know why this is happening?
I’m on hostgator’s baby plan with WordPress 3.1.4
Brian says
Have you had luck setting up DNS A records or CNAME so that an external website domain will redirect to your WP multisite? Hostgator seems to use an ip+username setup (ex 123.123.123.123/~username) so DNS A records won’t work (since they seem to only allow the IP address and not the /~username part. All redirects to Hostgator seems to end up pointing to a strange landing page which I cannot figure out (you can see what I mean at this one I’m trying to get working http://www.isoleaf.net/). I’m pretty sure it’s a HostGator issue because I’m having the same problem for all domains I have hosted on several different providers (e.g. godaddy, hostmonster, etc). Just curious if anyone has gotten it working using HostGator. Thanks.
lynn says
Thanks, for this post. This was the exact solution that I needed for my multisite. Moved from another host to Hostgator and all my sub sites seemed to disappear. Put in the wildcard subdomain and they are back.
Thank you
wantei says
The sub-domain is appearing is http://wanani.me/forum instead of http://forum.wanani.me
Bob Allen says
I have installed the multisite directions to my Hostgator site about five times and cannot get the “Network Admin” link to appear. I have contacted the techs who are telling me that the Hostgator WordPress does not do multisite work. They were really no help in this. I have deleted and reinstalled the program many times and still no link to Network Admin. Can you help or is the link not really needed. I have followed the directions in the email above and get the same results.
I eagerly await your reply,
Bob Allen
Blake Imeson says
Which HostGator plan are you on?
Brian says
Hi Blake. I have done all you stated and still cannot get past creating the multisites on http://christhub.com.. After they are created and I try to access, the pages just will not load. These are the dashboard page and the home page (view). Any ideas? BTW, I have a Baby Plan with HostGator.
Blake Imeson says
I’m frankly not sure, I’d probably just Google around for answer. Wish I had some idea.
lia says
hello blake,no luck for me
i have reseller package from hostgator and i already followed everything to make multisite works, but still no luck
every time i create new site (using subdomain) then it doesn’t work, can u suggest me what should i do?
Rohit says
Thanks for this wonderful tutorial. I tried implementing this a long time back from now, but I couldn’t get it to work. But after reading your article, I was able to get it done in 5 minutes flat.
Thanks a LOT!!
Steve says
Great document Blake. Helped me out immensely in setting up my first WP Multisite.
I did ran into some of the same problems I see above in getting Multisite to work on my Hostgator account. Turns out there is one more step you may have to do if you are using Hostgator.
You may need to go into the Advanced DNS Zone Editor in your sites cPanel and delete the webdisk.*.yourdomain.com. as this entry interferes with the Wildcard DNS setting.
Spent 30 minutes on chat with Hostgator and the support person finally figured it out.
Once that got removed all worked perfect.
Michael says
You may need to go into the Advanced DNS Zone Editor in your sites cPanel and delete the webdisk.*.yourdomain.com. as this entry interferes with the Wildcard DNS setting.
This helped me. Spend almost a day trying to fiz the subdomain issue and your solution helped me
Thanks
antonio says
waaa yo really help! thanks nice 2013
Marilyn says
Thank you Blake! But before working on the .htaccess and wp-config, you may want to set up 2 sub-domains in your cPanel or control panel first as:
*.yourdomain.com
and
example.yourdomain.com
Be mindful that the Document Root should only be
public_html/
Nothing should appear after public_html/ since the multisite will create the “example” directory for you.
Once done, go add your wildcard dns and the rest as Blake has mentioned. That will do!
Marilyn
Fatchamp
Client Services
http://fatchamp.me
The World’s Greatest Web Host
Harish says
I was also trying to set up wordpress multisite for sub-domains and I come across this site. Thanks for the post but in my case step-4 of adding blogs.dir was not needed at all. Just step 1 and step 5 are enough!
Majalah says
Just to share, If you want set up multisite on an add on domain, don’t forget to take attention to your document root. I’ve got this error and change the document root solved it.
For example, your add on domain: example.com and you want create multisite using sub domain, then your document root should /public_html/example.com NOT /public_html/ only.
hcd says
I think I am having a problem with this. This addon domain was done a long time ago, and now putting on multisite. Got installed correct and everything, now just having problems gettting to the site. When you say document root, are you talking about when you do the *.example.com? So say I had test.com as main, and example.com as addon. When I do the *.example.com, I should do the document root as /public_html/example.com?
Chris says
Huge hint for everyone that I wasn’t thinking clearly on when I was going through doing this…
When you set up the *.yourdomainname.com wildcard redirect it has to POPULATE throughout the whole internet before it will work properly.
So… set it up and come back a day later BEFORE you start on your networking install and it will work a lot easier.
Also… remember that if you are creating a MU site in an ADDON domain that your install will require the wildcard redirect to point to the FOLDER instead of public_html.
I know that has been written a few times here before but it wasn’t so obvious to me and I thought to mention it again.
Cheers
Chris
Zulfi says
Hi,
I have installed multisite and added themes. The problem is, when i type the domain WITHOUT www, the page gets failed and says no url found (with www works fine). Site is configured to www in General -> Settings before installing multisite.
I have provided the code given in “Create a network” page to replace in .htaccess file. Pls let me know what i need to do now. Thanks in advance.
Skumar singh says
I have installed WP with multi-site. The sub-domains are working fine.
How, can i execute multi-site to allow both ways –
http://skumar.domain.com
http://domain.com/skumar
If not possible, can you please let me know the what would be query string call so that i can define in Rewrite rule htaccess to run domain as folder.
index.php?network=skumar
AnimeGale says
Hey Blake,
So, I understand how to do it through WHM/cPanel, however, when I purchased my dedicated server, I opted not to have a cPanel license come along with it. Is there any way to add subdomains using only SSH/Shell? As if not, I need to dish out another $20/$30 per month for a cPanel license that I won’t use for anything other than subdomain creation.
Thanks,
Regards.
Dude7017 says
Somehow I must have mis-configured (skipped a step or something) the server prior to installation and activation of the WP network, and I was getting a “could not connect…” type of error as if DNS was not finding the subdomain.
However, it was fixed by following steps 1 and 4 above since all the other steps had already been completed. Up and running on HostGator Cloud server.
komal says
Worked like a charm! Thanks :)
Emem says
The only tutorial that helped me! Thanks buddy