Dear Dr. Website: When I go to some sites, for example, www.yoursite.com/~user/, I get a directory listing of ~user, but sometimes I get ~user/index.html. How do I set up my site to offer not the directory listing but index.html?
If you're running a Microsoft server,
the solution is simplicity itself. Go to the Internet Services Manager for your Web server and find the Directories tab, where you will see a checkbox labeled Enable Default Document. If you check that, the filename you specify will be the default for any directory under that server. Index.html is the most common, and we recommend it, but some installations use index.htm, welcome.htm(l), or default.htm(l). There's also a checkbox for Directory Browsing Allowed, which lets visitors view a directory listing if the default does not exist or is unreadable. You generally don't want this option turned on for Web servers, but you do want it for FTP servers so visitors can see what's there.
On Unix-based servers, such as Apache, it's still straightforward, just different. You'll have to edit the srm.conf file (in the conf directory, although some installations use the httpd.conf file for this instead), looking for (or adding, if necessary) lines containing several variables.
UserDir: this is where you specify the "default name" for a user's directory that would be visible to a Web visitor. It would look like
UserDir www
or
UserDir disabled
If you disable it, as in the line above (which does not set it to a directory called disabled!), this would mean that the user's home directory (~user) would also be their Web directory. Many ISPs have this set to public_html, which is the default.
DirectoryIndex: this is where you specify the file or files that can be used as the default when you visit a directory. You can set multiple files, and the first match will connect; just separate the names with spaces:
DirectoryIndex index.html index.htm default.html default.htm
Dear Dr. Website: My company is trying to develop an online catalog. All our data resides on an IBM AS/400, but I know we can write CGI programs to interface with our legacy code. What are the downsides, if any, to developing in straight CGI?
Each time a page references (calls) the CGI code,
a new process is spawned, which could put considerable strain on the server. You may want to use a program such as Attachmate's Host-to-Web Publishing System, which lets you easily put your AS/400 data online. Although it can use CGI, the system supports NSAPI and ISAPI, both of which allow you to avoid making repeated CGI calls.
Dear Dr. Website: After having an animated GIF load and play on a blank page, I want the next page to load automatically. Is there an easy way to do this?
Sure.
We whipped out this solution with Macromedia's Dreamweaver:
<p>
<script language="JavaScript">
function MM_goToURL() { //v1.2
for (var i=0; i<(MM_goToURL.arguments.length - 1); i+=2)
//with arg pairs
eval(MM_goToURL.arguments[i]+".location='"
+MM_goToURL.arguments[i+1]+"'");
document.MM_returnValue = false;
}
</script>
<img src=/old?u=http%3A%2F%2Fwebdeveloper.com%2Fdrweb%2F%26quot%3Blivetile.gif%26quot%3B&y=1999 width="116" height="60"
ALT="Internet World Live"
onLoad="MM_goToURL ('parent','http://webdeveloper.com');
return document.MM_returnValue">
<p>
|
For a working demonstration of Dr. Website's code, click here. Watch how WebDeveloper.com automatically loads from this page after the animated GIF finishes loading!
|
WebDeveloper.com shows you a lower-tech way to do this--but you'll have to guess at the load time.