One of my clients uses Windows hosting on Godaddy. They wanted to host a new WordPress website on a new subdomain when a WordPress website was already installed on the their primary domain. I wasn’t familiar with Windows IIS hosting at the time (WordPress is normally hosted on Linux servers), and so gathering this information took several days and a call to Godaddy Support before I figured it all out.
Here are the 4 steps to install WordPress on a subdomain in Windows IIS in Godaddy when a WordPress installation already exists on the primary domain:
- Upgrade to Deluxe or Ultimate Hosting
- Setup the Subdomain and Subfolder
- Create the web.config file in the Subdirectory
- Install WordPress Like Normal
1. Upgrade to Deluxe or Ultimate Hosting
Because they used Godaddy, they first had to upgrade to a deluxe hosting package as the base, “Economy” hosting plan does not allow you to host websites on subdomains. An upgrade was an extra $2 a month. Thanks to Chip O’Toole for this tip.
2. Setup the Subdomain and Subfolder
In Godaddy, this is done in the hosting control panel under “Manage Domains”. Click the domain you want to manage, and then create a new subdomain. It will prompt you to create a folder with the same or different name after that. Once a folder is created, go back to the control panel and setup a new FTP user account to access that folder if needed.
3. Create the web.config file in the Subdirectory
Once the hosting was upgraded, the subdomain still did not ‘show up’, but simply redirected to the primary domain’s website. To fix that, you have to create a web.config file in the subdirectory you created in step 2. To do that, go back to the hosting control panel and click on “File Manager”. Browse to the subfolder and then click new. Copy and paste the following code:
Note:Be sure to change the “www” to your subdomain name, “youranotherdomain.com” to your primary domain name, and “\your\sub…” directory path to the actual path.
PS. The “R:0″ are “back-references to condition patterns“.
4. Install WordPress Like Normal
You may not be able to use the one-click install application in Godaddy for a subdomain, but you can still manually install WordPress. First create a MySQL database. Record all of the info from setup such as database name, username, password, and host name. You’ll need all of that to configure WordPress. Next, download the latest installation files from WordPress.org. Unzip the file and upload to your sub-folder using FTP. Once the files have been uploaded, go to [subdomain.primarydomain] and follow the prompts to create a configuration file.