In Through the Out Door
By Randal L. Schwartz
Sometimes, people come in through the back door. This may be fine at your house, but it can present some challenging problems on your Web site. Suppose you set up a nice Web site with a great front-page graphic. While your visitors browse away, they may bookmark some of the later pages and perhaps even hand out those URLs to friends or post them on Web hotlists. This would increase the likelihood of visitors coming to your site without ever seeing your opening page. In certain situations, this can be a Bad Thing.
Suppose, for example, that your front page contains a legal disclaimer that applies to the entire site. You could just copy the disclaimer to each page, but that would merely aggravate people. Maybe your entire site is sponsored or supported by advertising; in either case, the sponsor notices must be seen.
To ensure that URLs that don't direct visitors to your opening page are never used, you can mangle the URLs slightly, so that each one points at a page on your site for a limited amount of time. Then the URL expires, and cannot be used again. This is possible if you don't serve the URLs directly, but instead are willing to let a CGI script handle all your documents. If such a script interests you, read on.
The Script
Every unexpired URL ends up looking something like: http://www.stonehenge.com/cgi/WT/1234567/col01.html, where 1234567 is the UNIX time of day when the URL was generated.