HTML and CSS Reference
In-Depth Information
If the URL ends in a slash, the last part of the URL is considered a directory name. The
file that you get using a URL of this type is the default file for that directory as defined
by the HTTP server, usually a file called index.html . If the web page you're designing
is the top-level file for all a directory's files, calling it index.html is a good idea. Putting
such a file in place will also keep users from browsing the directory where the file is
located.
You also can specify the filename directly in the URL. In this case, the file at the end of
the URL is the one that is loaded, as in the following examples:
http://www.foo.com/home/foo/index.html
http://www.foo.com/home/foo/homepage.html
Using HTTP URLs such as the following, where foo is a directory, is also usually
acceptable:
http://www.foo.com/home/foo
In this case, because foo is a directory, this URL should have a slash at the end. Most
web servers can figure out that this is a link to a directory and redirect to the appropriate
file.
Anonymous FTP
FTP URLs are used to point to files located on FTP servers—usually anonymous FTP
servers; that is, the ones that allow you to log in using anonymous as the login ID and
your email address as the password. FTP URLs also follow the standard URL form, as
shown in the following examples:
ftp://ftp.foo.com/home/foo
ftp://ftp.foo.com/home/foo/homepage.html
Because you can retrieve either a file or a directory list with FTP, the restrictions on
whether you need a trailing slash at the end of the URL aren't the same as with HTTP.
The first URL here retrieves a listing of all the files in the foo directory. The second
URL retrieves and parses the file homepage.html in the foo directory.
 
Search WWH ::




Custom Search