How to Create Subdomains
To add more subdomains, just create new subdirectories in the /htdocsdirectory.
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:
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:
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
Latest posts by Editor (see all)
- How to Show files by size, biggest last- Linux Commands - January 21, 2011
- How to test for unreadable blocks on disk- Linux Commands - January 21, 2011
- How to Do a read speed test on disk sda – Linux Commands - January 21, 2011