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.

2011 04 06 1039 Enable WordPress Multisite with Subdomains (HostGator)

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