Home
 

Customer Support

Search for keywords:

Browse by category:

How do I create subdomains?

Everyone has a "www" subdomain (In "www.yourdomain.com", the "www" part is the subdomain). The www subdomain is created by, and serves files from, your /htdocs/www directory on the filesystem.

To add more subdomains, just create new subdirectories in the /htdocs directory.

For instance, if you had the domain name mychevycars.com and wanted a subdomain for Corvettes, then you would just create the directory /htdocs/corvettes and upload the files in there that you wanted to see at http://corvettes.mychevycars.com

Second Level Subdomains
To create second level subdomains like www.corvettes.mychevycars.com ("www" is the second level subdomain and "corvettes" is the first level subdomain in this example) then you would do one of the following:

1. If you have made an /htdocs/corvettes directory so that you have http://corvettes.mychevycars.com then you can make http://www.corvettes.mychevycars.com by getting a shell prompt and creating a symlink like so:
cd /htdocs
ln -s corvettes www.corvettes
Now http://www.corvettes.mychevycars.com will lead to the same place as http://corvettes.mychevycars.com and all the files for both of these URLs are uploaded in the /htdocs/corvettes directory.

2. Alternatively, you may want your second level subdomain to lead to a separate area of your website instead of being symlinked together with the first level subdomain. For example you may want http://splitbumper.corvettes.mychevycars.com (where "splitbumper" is the second level subdomain) to lead to a section of your website dedicated to 1963-1965 Corvettes with split bumpers, and have http://corvettes.mychevycars.com just lead to a different section of your site about Corvettes in general. To setup the second level subdomain this way, you would make a separate directory altogether for it, like this:
cd /htdocs
mkdir splitbumper.corvettes
The "splitbumper.corvettes" subdirectory is created right alongside all the other subdomain subdirectories, including the "corvettes" subdirectory, if you made one. Then you upload files related to splitbumpers into the /htdocs/splitbumper.corvettes subdirectory, and view them in a browser at http://splitbumper.corvettes.mychevycars.com

User-Contributed Notes

add a note
06-Mar-2003 12:27
If you need to delete a subdomain symlink made with the "ln -s ..."
  
     rm -f /htdocs/www.corvettes

08-Oct-2003 09:30
Make sure the directory name you create is all lower-case, with no
spaces. CAPS or Mixed-Case will not work.

tru -at- ascribedata.com
07-Nov-2003 21:09
Careful that you only use letters, numbers and (I think) hyphens in your
sub-domains. I spent a whole day debugging and wondering why PHP
sessions weren't carrying through page to page. It was because I had an
underscore in the subdomain. As soon as I changed the subdomain name not
to have an underscore, then PHP sessions worked again and I could login
to my application. 

add a note

Related Questions:


Why does it say "directory not empty" when I try to remove a directory?

How do I get Shell access to the server?

What is the real full path to my home directory?

Where do I put my webpages and files?

How do I upload and edit my files?

Can I have a catch-all subdomain?

Why do I keep getting old copies of my pages when I just updated and changed my files?

How do I change my password?

When will my site be activated?

How do I get to one of my subdomains from a temp.modwest.com or secure.modwest.com URL?

Can I switch my domain name or alter my administrator username?

How do I recreate the "_" symlink that directs mydomain.com to www.mydomain.com?

Why do I Get an Error Page When Accessing Webmail with Internet Explorer?

What kind of resource limits do you have for your shared hosting environment?

What do I need to know about the different environment introduced in May 2009?

How do I create multiple identities when sending via Modwest webmail?

I need help with Plesk on my VPS or Managed Server!

Does Modwest charge for "domain parking?"

Why does my php_error_log say that my site is missing the XML library?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Modwest PHP Hosting      Copyright 2000-2009 by Modwest, Inc.      About    |    Blog    |    Community    |    Design    |    Jobs    |    Contact