How do I create subdomains?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

Every Web hosting plan we offer includes unlimited subdomains. Subdomains let you display different websites to visitors who use different "host names" in the Web browser address bar.

For example, if your domain name is "example.com", you could display a different website to people who visit "sales.example.com" and "www.example.com". Another use of subdomains is creating personal websites for family members, such as "robert.example.com" and "mollie.example.com".

On this page:

Creating subdomains

Our subdomain feature is easy to use: just create a new directory (folder) at the top level of your website directory. The new folder will instantly become a subdomain.

In other words, it's easy to create a subdomain like sales.example.com. Just add a folder named sales to the top level of your website, then put a normal index file in that folder.

If you’re using WordPress instead of creating your own index files, our WordPress installer gives you the option of creating it in a subdomain.

You can create unlimited subdomains at no extra charge, and they start working immediately.

Make sure to name your directory so that it only contains lowercase letters, numbers and hyphens. It shouldn't contain any uppercase letters, spaces, dots, or other unusual characters. For example:

  • If you name your directory "sales", it can be accessed as http://sales.example.com/, http://www.sales.example.com/, http://Sales.example.com/, http://www.Sales.example.com/, etc. As long as the folder name you create is all lowercase, you can use lowercase or uppercase letters in the URL to access it later.
  • If you name your directory "Sales", it won't work as a subdomain because the name contains an uppercase letter. Use only lowercase letters for the folder name.
  • If you name your directory "internal sales", it won't work as a subdomain because the name contains a space. Change it to a name like internal-sales.
  • If you name your directory "internal_sales", it won't work as a subdomain because the name contains an underscore. Change it to a name like internal-sales.

(Note that these instructions assume that we’re handling the DNS for your domain name and that like most customers, you haven’t pointed the hostname elsewhere or disabled wildcard subdomains.)

Reserved subdomain hostnames

For technical reasons, you can’t use these exact subdomain names on a website, because they’re reserved for other purposes:

  • ftp
  • lists

Subdomains and "www."

Using "www." in a Web browser is optional with subdomains. For example, "http://sales.example.com/" and "http://www.sales.example.com/" would show the same thing.

If your site uses SSL, make sure your SSL certificate covers all the hostnames you use (see the next section).

Subdomains and SSL certificates

If you use an SSL certificate for your subdomain, you may need to add the new hostname to your certificate, especially if the hostname is at a different level from (has more dots than) hostnames that already work for your site.

For example, if you already use "http://www.example.com/" successfully, in most cases the certificate will already work for "http://sales.example.com/", because it’s at the same level. But it probably won’t automatically work for "http://www.sales.example.com/" because there’s an extra level (one more dot).

If you want a certificate to work with both "http://sales.example.com/" and "http://www.sales.example.com/", you can do that, but be sure to request both of those as additional hostnames.

Subdomains and mod_rewrite

If you're using Apache mod_rewrite RewriteRules in a .htaccess file in a subdomain directory, you'll usually need to also add a line like this to your .htaccess file:

RewriteBase /

This tells the Apache Web server to avoid prepending the subdomain directory name to the rewritten address.

Subdomains and email

For technically advanced customers, we also support email for subdomains, with the restriction that messages sent to an address @subdomain.example.com will be treated just like messages sent to the same address @example.com.

For example, if you want mail sent to "example@mail.example.com" to be handled as if that message had been sent to "example@example.com", that's possible.

Most customers should not do this.

Using subdomains for email is likely to be less reliable for technical reasons (including, but not limited to, SPF and DKIM checking at other companies). This technique is described here only for customers who transfer to us with things already set up this way, and who have no alternative but to continue doing it.

To make this work, you'll need to add a DNS "MX" entry for the subdomain, pointing it to mx.tigertech.net. (The MX priority and "time to live" don't matter.)

If you want to use the same subdomain on your website, you’ll also need to add an “A record” pointing to the special target default.

Adding the custom DNS MX entry makes sure that incoming mail for the subdomain will be routed to our mail servers, and it also tells our mail system to treat the subdomain as a valid addresses. Once you do this, you can use that subdomain address as the "from" address in outgoing mail, too.

Subdomains with different directory names

The method described above — creating a directory called "sales" when you want a subdomain called "http://sales.example.com/" — is quick and easy.

Occasionally we're asked how to create a subdomain that does not use the same directory name. Technically advanced users can do this by creating a symlink using the shell.

For example, to make "http://sales.example.com/" use a directory named "my_private", you could create a new symlink named "sales" pointing to "my_private":

$ cd /var/www/html/ex/example.com
$ ln -s my_private sales

Treating "www" as a subdomain

Normally, "http://www.example.com/" is not treated as a subdomain. Even though the visitor is using "www" as part of the address, our servers will not look for a directory named "www" and try to use the files it contains. Instead, our servers will use the files at the top level of your site.

This makes sure "http://example.com/" and "http://www.example.com/" are handled identically, which is almost always what you want to happen.

In rare cases, technically advanced users may wish to treat "http://www.example.com/" as a "www" subdomain, just like any other subdomain.

As an example, if you've divided parts of your website into different projects that are maintained by separate systems or people, you may want to make sure that your "www" project is in a separate directory of its own that doesn't contain any other project directories.

You can do this by adding an empty file with this special name to the top level of your website (or asking us to do so):

.tigertech-treat-www-as-subdomain

If that file exists, requests for "http://www.example.com/" will use a "www" directory if possible.

Note that doing this may require you to make other small changes to your site. For example, if you place a "cgi-bin" directory inside your new "www" directory, you'll need to enable it as described on the "Making Additional Directories Executable" page, just like a "cgi-bin" directory on any other subdomain.

In addition, this change won't affect requests for "http://example.com/", because those don't include the "www". You may wish to redirect those visitors to the www version of your site.

Disabling subdomains

You can disable subdomain handling in various ways, depending on exactly what you want to happen instead.

If you want to prevent our servers from treating a particular directory as a subdomain, you can create an empty file named ".tigertech-disable-automatic-subdomain" inside the directory.

If you instead want our servers to send all subdomain attempts to your main hostname, you can do so using a .htaccess file. These lines, for example, will redirect any hostname other than “www.example.com”:

RewriteEngine On
RewriteCond %{HTTP_HOST}  !^www.example.com$ [nocase]
RewriteRule ^(.*)         http://www.example.com/$1 [last,redirect=301]

Finally, you can disable all wildcard subdomains at the DNS level by overriding or suppressing the “*.example.com” wildcard subdomain DNS entry.

Pointing subdomains via DNS records

All of the information above discusses how to create a subdomain with content in a subfolder on our server. It's also possible to create a subdomain by creating a DNS "A" or "CNAME" record that points to another server elsewhere on the Internet.

For example, you might host your main website with us (at "http://www.example.com/"), but use an external e-commerce service for a store to sell your products. The store might require you to create a DNS "CNAME" record that points "http://sales.example.com/" to their server.

You can easily create a DNS "A" or "CNAME" subdomain record using our control panel.