When you set up your Web site, you indicate which directories contain the documents that you want to publish. The Web server cannot publish documents that are not within the directories you specify. To plan your Web site, you first determine how you want your files organized. You then use Internet Service Manager to identify which directories are part of the site.
If your Web site consists of files that are all located on one hard disk on the computer running Internet Information Server, you can start publishing documents immediately by simply copying your files into the default home directory, C:\InetPub\Wwwroot. For an FTP site, copy your files into C:\InetPub\Ftproot. The procedures in this section explain how to change the default location of your files and add directories that are located on other hard disks or on computers across the network.
Each Web or FTP site must have one home directory. The home directory is the central location for your published pages. It contains a home page or index file that welcomes customers and contains links to other pages in your site. The home directory is mapped to your site’s domain name or to your server name. For example, if your site’s Internet domain name is www.microsoft.com and your home directory is C:\Website\Microsoft, then browsers use the URL http://www.microsoft.com to access files in your home directory. On an intranet, if your server name is AcctServer, then browsers use the URL http://acctserver to access files in your home directory.
A default home directory is created when you install Internet Information Server and when you create a new Web site. You can change the home directory; for instructions, see Changing the Home Directory.
To publish from any directory not contained within your home directory, you create a virtual directory. A virtual directory is a directory that is not contained in the home directory but appears to client browsers as though it were.
A virtual directory has an alias, a name that client browsers use to access that directory. Because an alias is usually shorter than the path name of the directory, it is more convenient for users to type. An alias is more secure; users do not know where your files are physically located on the server and cannot use that information to modify your files. Aliases make it easier for you to move directories in your site. Instead of changing the URL for the directory, you change the mapping between the alias and the physical location of the directory.
For example, suppose you are setting up a Web site on your company’s intranet for information related to an airline called Exploration Air. Your Web site is called ExAir. The following table shows the mapping between the physical location of the files and the URL that accesses the files.
Physical Location |
Alias | URL Path |
---|---|---|
C:\Wwwroot | home directory (none) | http://exair |
\\Server2\Scripts\Admin | SiteAdmin | http://exair/siteadmin |
C:\Wwwroot\FreqFlier | None | http://exair/freqflier |
C:\Wwwroot\Images | None | http://exair/images |
D:\Mktng\PR | PR | http://exair/pr |
Both virtual directories and physical directories (directories without an alias) appear in Internet Service Manager. A virtual directory is indicated by a folder icon with a globe in the corner. The following illustration shows the Web site example described above; /SiteAdmin and /PR are virtual directories:
For a simple Web site, you may not need to add virtual directories. You can simply place all of your files in the site’s home directory. If you have a complex site or want to specify different URLs for different parts of your site, you can add virtual directories as needed. For instructions, see Creating Virtual Directories.
When a browser requests a page on your Web site, the Web server locates the page identified by the URL and returns it to the browser. When you move a page on your Web site, you can’t always correct all of the links that refer to the old URL of the page. To make sure that browsers can find the page at the new URL, you instruct the Web server to give the browser the new URL. The browser uses the new URL to request the page again. This process is called “redirecting a browser request” or “redirecting a URL.” Redirecting a request for a page is similar to using a forwarding address with a postal service. The forwarding address ensures that letters and packages addressed to your original residence are delivered to your new residence.
Redirecting a URL is useful when you are updating your Web site and want to make a portion of the site temporarily unavailable, or when you have changed the name of a virtual directory and want links to files in the original virtual directory to access the same files in the new virtual directory. For instructions, see Redirecting Requests to a Directory.