in reply to Automatic execution of a CGI program on a web page besides a counter

Thanks to all who offered their help!

I just got off the phone with my ISP and have found out the following information - your mileage may vary. :)

I already knew that browsers look for index.html when you type in www.myhost.com

What I found out was ( and forgive me if this is commmon knowledge ) that failing the index.html page, the next in the sequence is index.htm, then index.*.

So to make an index page that changes every time the browser opens it, I can do a CGI script to accomplish this and just name it index.cgi and the browser will take care of the rest.

Like I said above, your mileage may vary.

p.s. Can someone point me to a node on how to update an original post? Thanks!

Some people fall from grace. I prefer a running start...

Update 5/30/02

After playing around with this last night I discovered that my provider does NOT handle a .pl file well. No matter what your permissions are, it wants to send you the source.

However changing the extention to CGI worked just fine.

  • Comment on Update: Automatic execution of a CGI program on a web page besides a counter

Replies are listed 'Best First'.
Re: Update: Automatic execution of a CGI program on a web page besides a counter
by chromatic (Archbishop) on May 27, 2002 at 05:54 UTC
    Actually, that's done by the web server. It's also configurable. If I wanted, I could have the default page in a location be 'monkeys.monkeys.monkeys'. (Half the fun of programming is breaking the expected rules.)

    As for updating top-level nodes, it's disallowed in this section, except for typo fixes. The best approach is to do as you've just done by replying. Good job.

Re: Update: Automatic execution of a CGI program on a web page besides a counter
by newrisedesigns (Curate) on May 27, 2002 at 14:53 UTC

    PopcornDave,

    In regards to what chromatic said, you should look into pointing users that go to "www.myhost.com" to index.shtml. By having an index written with SSI and Perl, i think you'll be able to reap the most benefits.

    I'm not against writing a whole website in Perl, however,

Re: Update: Automatic execution of a CGI program on a web page besides a counter
by darkphorm (Beadle) on Nov 29, 2002 at 21:40 UTC
    Actually, this depends greatly on the server-side configuration. For apache, you can define in httpd.conf what files are considered "index" files. On mine, it will check for an index.html, index.cgi, or index.php. If you want to repoint to a CGI type file and index.cgi is not processed, try an index.html with a "refresh" metatag that points to a new page.
    <META HTTP-EQUIV="Refresh" CONTENT="0; URL=/cgi-bin/index.cgi">