Welcome to WebmasterWorld Guest from 54.167.157.247

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

How can i display a cgi script on...

   
7:01 pm on Jul 12, 2003 (gmt 0)

10+ Year Member



... by default when someone types in mysite.com .. instead of index.html showing?

This is for a directory iam creating so i need cgi-bin/mydir/index.cgi showing, if you know what i mean :)

Mick

8:22 pm on Jul 12, 2003 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



You write the index.html page with normal HTML head and body, normal HTML tags, and so on, and then reference the script inside that file. The script then outputs whatever it does into the body of the index page that is being sent out to the browser.
8:43 pm on Jul 12, 2003 (gmt 0)

10+ Year Member



If you are using Apache, use the DirectoryIndex directive in the httpd.conf or .htaccess:

[httpd.apache.org...]

Thus:

DirectoryIndex index.cgi index.html index.htm

would look for index.cgi first, then index.html, etc.

I'm sure you can do this in IIS if you are using a Windows server, but as I don't, I don't know how!

3:40 pm on Jul 13, 2003 (gmt 0)

10+ Year Member



You write the index.html page with normal HTML head and body, normal HTML tags, and so on, and then reference the script inside that file. The script then outputs whatever it does into the body of the index page that is being sent out to the browser.

g1smd can you go into more detail about how to do this? , thats just what iam looking for...

8:07 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



To include the cgi script in the html page, put a tag like the following in the body of your page:

<!--#include virtual="/cgi-bin/mydir/index.cgi"-->
or
<!--#exec cgi="/cgi-bin/mydir/index.cgi"-->

Depending on your server you may need to change the page to index.shtml
Hope that helps.
Dave

10:10 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



Thanks that done the trick :)
8:15 pm on Jul 24, 2003 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Ooops. Sorry, I didn't see that this thread had been bumped.

Glad you eventually got the answer you required.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month