Writing for the Web

Tips for the Web Editor

URLS

Remember to always put the "/" behind a directory name in URLs. 听

Traditionally, URLs that pointed to files did not include the trailing slash, while URLs that pointed to directories do include the trailing slash. This means that:

http://webdesign.about.com/example/听is a directory, while听
http://webdesign.about.com/example听is a file

This helps speed up page loading because the trailing slash immediately tells the web server to go to that听example/听directory and look for the听 听or other default file.

When you go to a URL without the trailing slash, the听听looks for a file with that name. If it doesn鈥檛 find a file with that name, then it looks for a directory and looks for the default file in that directory.

Why it's bad 听| 听Leaving Off the Slash Results in a Redirect 鈥 Redirects Slow Down Web Pages

When you leave off the slash on a URL that is pointing to a directory, you are forcing the server to do a听. While it may seem instantaneous to you, it does take slightly longer for a page to load from a redirect than from the direct URL. And every little bit adds up.

But for file names , you should NOT include a slash at the end. 听For example:

Type:听
http://webdesign.about.com/example.html
Not:听
http://webdesign.about.com/example.html/