• Skip to main content
  • Skip to footer

Blake Imeson

Web Entrepreneur | WordPress Geek

  • Home
  • About Blake
  • Connect with Me
  • Contact

Blake Imeson / June 12, 2010

Enable WordPress Multisite with Subdomains (HostGator)

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.

image

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?

Further Reading

  • WordPress 3.0 Walkthrough: Getting Started with Multisite
  • What To Do Or Consider After You Enable Multisite In WordPress
  • Common WordPress Multisite Problems and Solutions
466
SHARES
LinkedinShareTweetSubscribe to BlogEmail
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Email Address Subscribe Now

Filed Under: Tech Tagged With: DNS, multisite, subdomains, WordPress

Related

Reader Interactions

Comments

  1. Todd Lohenry says

    July 9, 2010 at 11:17 am

    I’ve done all this, but I’m not having any luck mapping domains to the ‘child’ sites I create. Any input?

    Reply
  2. Poor Uncle says

    October 29, 2010 at 11:06 pm

    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?

    Reply
    • Blake Imeson says

      October 30, 2010 at 9:00 am

      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.

      Reply
  3. Ronnie says

    March 17, 2011 at 5:15 am

    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…

    Reply
    • Blake Imeson says

      March 17, 2011 at 8:43 am

      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 :(

      Reply
  4. Ewergren says

    April 6, 2011 at 9:30 am

    Which HostGator plan are you using? Will this work on hatchling or baby?

    Reply
  5. Ewergren says

    April 6, 2011 at 9:30 am

    Oh and that image is still not working.

    Reply
  6. Blake Imeson says

    April 6, 2011 at 10:42 am

    @Ewergren I have a reseller account with them but any of their plans should do this.

    I also replace the image. Thanks.

    Reply
    • Paulo says

      August 23, 2013 at 3:21 pm

      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?

      Reply
  7. Michael says

    July 1, 2011 at 1:03 pm

    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 ?

    Reply
    • Blake Imeson says

      July 7, 2011 at 1:50 pm

      @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.

      Reply
    • Tore says

      December 3, 2011 at 1:34 pm

      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.

      Reply
  8. shawn sandy says

    July 20, 2011 at 6:09 pm

    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/

    Reply
  9. Sharon says

    August 2, 2011 at 10:10 pm

    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

    Reply
  10. Brian says

    February 4, 2012 at 9:48 pm

    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.

    Reply
  11. lynn says

    April 30, 2012 at 9:25 am

    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

    Reply
  12. wantei says

    June 13, 2012 at 12:41 pm

    The sub-domain is appearing is http://wanani.me/forum instead of http://forum.wanani.me

    Reply
  13. Bob Allen says

    August 4, 2012 at 12:28 pm

    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

    Reply
    • Blake Imeson says

      August 6, 2012 at 11:47 am

      Which HostGator plan are you on?

      Reply
  14. Brian says

    November 16, 2012 at 7:42 am

    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.

    Reply
    • Blake Imeson says

      November 16, 2012 at 9:37 am

      I’m frankly not sure, I’d probably just Google around for answer. Wish I had some idea.

      Reply
  15. lia says

    December 19, 2012 at 4:47 am

    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?

    Reply
  16. Rohit says

    December 19, 2012 at 11:06 pm

    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!!

    Reply
  17. Steve says

    December 28, 2012 at 11:49 am

    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.

    Reply
    • Michael says

      May 9, 2013 at 10:35 pm

      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

      Reply
  18. antonio says

    January 10, 2013 at 2:49 pm

    waaa yo really help! thanks nice 2013

    Reply
  19. Marilyn says

    January 12, 2013 at 1:33 am

    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

    Reply
  20. Harish says

    January 15, 2013 at 2:20 pm

    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!

    Reply
  21. Majalah says

    May 31, 2013 at 11:14 pm

    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.

    Reply
    • hcd says

      July 31, 2013 at 11:52 am

      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?

      Reply
  22. Chris says

    October 26, 2013 at 8:38 pm

    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

    Reply
  23. Zulfi says

    September 5, 2014 at 11:38 pm

    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.

    Reply
  24. Skumar singh says

    December 3, 2014 at 10:23 am

    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

    Reply
  25. AnimeGale says

    February 9, 2015 at 9:35 am

    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.

    Reply
  26. Dude7017 says

    October 22, 2016 at 12:30 am

    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.

    Reply
  27. komal says

    December 16, 2016 at 10:05 am

    Worked like a charm! Thanks :)

    Reply
  28. Emem says

    June 20, 2017 at 1:20 am

    The only tutorial that helped me! Thanks buddy

    Reply

Trackbacks

  1. Publishing my thesis with Wordpress and Digress.it – Part 1 | ClintLalonde.net says:
    March 3, 2012 at 11:21 am

    […] to trusty Google to try to find a solution, and it didn’t fail me.  Once I had cPanel configured correctly and my directory structure set up (although I am not […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

Blog Categories

Blog Archives

Blog Topics

.com 2.7 2008 addons AlphaLab Amazon applications apps April Fools autodidactic backup bailouts Blogging blogs bootstrapping CMS college CSS Del.icio.us efficiency email Entrepreneurship Facebook Firefox Gmail Google Google Apps Grove City College internet entrepreneurship LinkedIn links PCPGH3 plugins reputation management RSS SEO Seth Godin shared Social Bookmarking Social Media technology themes website Wikipedia WordPress

Copyleft © 2008–2023 Blake Imeson · Powered by WordPress of course

  • Home
  • LimeCuda.com
  • LimeCuda Portfolio
  • FewerThanThree.com
  • Sitemap

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.