Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How to make index.pl the default?

by kiat (Vicar)
on Apr 22, 2003 at 23:31 UTC ( #252399=perlquestion: print w/replies, xml ) Need Help??

kiat has asked for the wisdom of the Perl Monks concerning the following question:

Hey monks,

I'm curious how on this site the file index.pl is parsed by the server as the default file. Most servers treat index.html or index.htm as the default file. How does one make index.pl or index.cgi the default file like index.html? I would to have, say, www.mysite.com/index.cgi, automatically loads up when the site www.mysite.com is accessed. How does one do that? Is it a server side thing that can only be done by the server hosting company?

Thanks in anticipation.

Replies are listed 'Best First'.
Re: How to make index.pl the default?
by jasonk (Parson) on Apr 22, 2003 at 23:38 UTC

    Most web servers can be configured to treat any filename you want as the default, for Apache this is done with the DirectoryIndex directive, for other servers there should be a similar setting.


    We're not surrounded, we're in a target-rich environment!
Re: How to make index.pl the default?
by TVSET (Chaplain) on Apr 22, 2003 at 23:39 UTC
    That's easy :)

    You have to configure your server to use index.pl or index.cgi (or whatever you want) as a default Index page. If you are using Apache web server, then you have to use DirectoryIndex directive. Here is a an example from my config (/etc/httpd/conf/httpd.conf):

    # # DirectoryIndex: Name of the file or files to use as a pre-written HT +ML # directory index. Separate multiple entries with spaces. # <IfModule mod_dir.c> DirectoryIndex index.epl index.html index.htm ndex.shtml index.php + index.php4 index.php3 index.phtml index.cgi index.epl index.pl index +.mhtml index.mpl </IfModule>

    It is possible in any(?) other server too. I've seen it even in MS IIS, but don't remember where. :)

    Leonid Mamtchenkov

      If you are using Apache then this can also be placed in a file called .htaccess in your website directory, so you don't need to configure the server itself. Seach google for 'htaccess'.

Re: How to make index.pl the default?
by The Mad Hatter (Priest) on Apr 22, 2003 at 23:44 UTC
    It is an option to turn on in Apache's httpd.conf. Check out the option DirectoryIndex in Apache's documentation.
Re: How to make index.pl the default?
by Abigail-II (Bishop) on Apr 22, 2003 at 23:46 UTC
    That isn't really a Perl question, is it? I suggest asking in the Python community how to make index.py the default, and then replace py with pl in their answer.

    Or you could just read the manual page of your server, because it's a server issue, and it depends on the server whether this is possible, and if, how. The language in which the program is written it totally irrelevant.

    Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://252399]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2019-05-22 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (140 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!