This isn't so much a question on how to use perl, but how to best implement something written in perl. I've been working on a website that serves every page via perl CGI, but I'd now like to hide the "/cgi-bin/" in the page addresses. I currently have www.mysite.com/ using SSI in www.mysite.com/index.shtml to serve www.mysite.com/cgi-bin/home.cgi, and so I was thinking of doing the same thing with all other pages, for example, www.mysite.com/products/index.shtml serving /cgi-bin/products.cgi, etc, thus making a directory for each .cgi in /cgi-bin/ with an index.shtml in each directory. Obviously, this directory making nonsense would be automated by a perl script. :)

However, I've been recommended by a friend of a friend ( who may be a PHP or visual basic programmer for all I know ) that the better way to accomplish this is by using a .htaccess file directive using mod_rewrite. In order to do this, I think I'd have to do the same thing with directories with a .htaccess file in each directory for each .cgi, or have a line or two per .cgi file in the root .htaccess.

My question is this: which of these two methods is better, and why? Or do you know of a third method that works better than either of these?


In reply to mod_rewrite VS SSI VS your better idea by derekstucki

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.