Having multiple domains point to the same WordPress blog

We’re making some business changes to The Bloomery, and combining two different sites into a single WordPress blog.  The outcome we want is multiple domains all pointing to the main blog.  And we want to run it on Windows/IIS.  Out of the box, WordPress is designed for a single blog with a single domain, but there are a number of settings and plugins that we used to end up with what we wanted.

With WordPress 3.0, there is a new Multisite Network option, where multiple blogs can be created in the context of a single installation, and different domains can map to each of the child blogs.  There is the option of using subdomains (blog1.mysite.com, blog2.mysite.com) or subdirectories (mysite.com/blog1/, mysite.com/blog2/).  When you set up Multisite, you have to choose one or the other, and you can’t change once you’ve made your choice.  In either case, you have to make some edits to the .htaccess file for URL redirects/rewrites.  On IIS 7, there is no .htaccess file, but we can accomplish the same thing with the web.config and the URL Rewrite Module.

Make sure all your domains point to the correct hosting account, and install WordPress.  After installing WordPress, here’s what needs to be done:

1. Set up a Multisite Network using subdirectories; follow the steps at http://www.lauragentry.com/wordpress/?p=517.

2. Install the WordPress MU Domain Mapping plugin, from http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/.  You need to do a manual installation, but it’s easy.  For some additional information on this plugin, see http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/.

3. The main site is assigned a site ID of 1.  From the main site’s control panel, under the Super Admin, you want to add all your domains with a site ID of 1.  They won’t show up in the mapping, so just try and visit each of your domains to see if they all point to the main site.

Installing WordPress on DiscountASP.NET

Background

I’ve had personal and client sites hosted on DiscountASP.NET for 5 or 6 years now, and I’ve been very happy with them as a host.  I’ve found the first annoyance recently—despite being the most popular blogging platform in the world, running just fine on IIS, and being included in the Web Platform Installer, DiscountASP.NET does not have a one-click installation for WordPress.  Not a big deal, the installation is really easy.

This process assumes you’re doing a new installation, and that there is no content to migrate.  I’ll cover content migration options in the next post.

What you’ll need

  1. Hosting account
  2. Add MySQL option to your hosting account.
  3. WordPress download, from http://wordpress.org/
  4. FileZilla FTP program, from http://filezilla-project.org/.  FileZilla is the best FTP program to use with DiscountASP.NET.  I’ve tried others, but they hold connections open making directory manipulation impossible.

The Process

Provision a MySQL Database

First step—log in to your hosting control panel, and add a new MySQL database.  After you log in, go Database Management >> MySQL Manager.  If you don’t see MySQL Manager, you need to add MySQL to your hosting account.

The first options you’ll set are the database name, the username, and the amount of disk space to allocate (you add the password in the next step).  Click Create.

image

Once the database has been created, it will be listed with any other MySQL databases you have.  To change the password, click Manage.

image

Click Update Password, enter the new password, and click Update Password.  The database is now configured.  You’ll need this configuration information in the next step.image

Add a Default Document

While you’re still in the Control Panel, go Tools & Utilities >> IIS Tools, and click on the Default Documents tab.  Add index.php to the list.  This allows visitors to browse your blog without specifying the file name in the URL.

image

Installing WordPress

Unzip WordPress, and follow the 5-Minute Install instructions.  The important part is the second step, where you rename the config file and edit the database information (see http://codex.wordpress.org/Editing_wp-config.php).  Edit the file with Notepad or your favorite text editor.  You only need to change the four settings listed at the top of the help page.

Once that is done, connect to your site with FileZilla.  If you want to install WP in a subdirectory (such as www.mysite.com/blog), create the subdirectory.  Otherwise, delete the files in the root.  Then, upload all of the WordPress files to your site.

In order to populate the database tables, run the installer at www.mysite.com/wp-admin/install.php (or www.mysite.com/blog/wp-admin/install.php).  On the first page, you’ll set your blog’s title and create the initial user.  Make sure you keep track of this password!

image

If all goes well, you’ll see this:

image

You’re now ready to log in and start using your blog!