There are two simple ways to do this, both of which are probably deplorable to people who know how to work apache properly, but i use them all the time. As far as I know both will allow the spidering of at least that page: if your onward links involve cgi-bins and query strings then those might not.

The global server configuration will quite often include index.cgi towards the end of the DirectoryIndex line, in which case all you have to do is make sure that a file with that name is the only index in your directory. Well, probably not all: you may have to create the .htaccess file that allows ExecCGI in that directory, and so on: that's all described by other people here. You shouldn't need to change the default type, though, and it means that you can link to directory/ and people don't see the cgi part at all.

Obviously, you also have to make sure that both the cgi and the directory are chmod 755. i only mention it because i spent several hours last night debugging scripts that were in a directory without +x (funny how you can always find bugs, though.)

The other possibility is even more low-tech, and only really useful on a very restricted server. If you can't do anything else, create an index.shtml file containing only an SSI tag to invoke the script you want, with query string in the usual way. You can do that with either <!--#include virtual="..."--> or <!--#exec cgi="..."--> according to taste. The main problem is that you sacrifice control of the headers, to the extent that you often can't even set a cookie. It's also rather inefficient, but it is a nice, quick and dirty way of putting a straight face on a cgi, and it's not hard to read parameters from the address of the calling page if you need to.

If you can't even get SSI then it's the wrong server.

I realise these are not the elegant solutions you were looking for, but i hope it's useful all the same.


In reply to Re: defaulting to a perl script: some dirty solutions by thpfft
in thread defaulting to a perl script... by Shadowfax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.