Forum Moderators: coopster & phranque

Message Too Old, No Replies

Calling cgi script from home directory

         

mbaze

5:38 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



I'm installing a cgi classified ads program that resides in the cgi-bin. I want the listing of ads to appear when people first go to my web site at www.mydomain.com. But the script, which displays the ads, is called from the cgi-bin at www.mydomain.com/cgi-bin/classifieds.cgi. How can I have visitors invoke the script when they first visit my home directory? Is there a way? Tell me I'm missing something obvious.

Michael

tombola

9:07 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



Add this line to all your Web pages, where you want to insert the ads:

<!--#exec cgi="/cgi-bin/classifieds.cgi" -->

mbaze

9:45 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



Thanks. I was thinking after I posted originally, would another solution be to rewrite the home page URL to strip off the /cgi-bin/classifieds.cgi? Is that an option?

Scratch that. That doesn't quite make sense, does it?

lexipixel

12:48 am on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



tombola's suggestion for using SSI will only work with a few things in place-

1). server must be able to process SSI/CGI calls for that page, (some servers will only do this is the page is name filename.shtml).

2). The script must be able to output the text/html content without sending the <HTML>, <TITLE>, <HEAD>, <BODY>, etc tags... if the SSI exec call is placed in the BODY of another (.shtml) document.

The other answer is to redirect [domain.com...] to [domain.com...] either in the server setup or via an index.htm page in the web root directory with an META refresh tag.

just my $0.02...

mbaze

3:21 am on Sep 5, 2004 (gmt 0)

10+ Year Member



I had thought of a redirect. I'm wondering what the search engine spiders will do with that.

jatar_k

12:13 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



redirecting the home page is not a good idea for spiders.

the exec would be the best way.