Please excuse the slightly off-topic post...

How do i set up a unix webserver so all accesses to a particular directory (and below) get *handled* by a perl script? (ie, similar to the way java servlet's can act)

For example:

http://www.domain.com/thedirectory/ => /cgi-bin/path/myscript.pl ('/') http://www.domain.com/thedirectory/foo => /cgi-bin/path/myscript.pl ('/foo') http://www.domain.com/thedirectory/foo/bar => /cgi-bin/path/myscript.pl ('/foo/bar')
or something to that effect.

Note that i dont want a simple redirection because that changes the url in the address bar, and doesn't give me access to the original path requested. Also, i need to do things like return images and http redirects so just inserting text into a shtml doc isn't likely to work. And, just to make things tricky, i don't have root access to this particular server...

Any comments appreciated!

- ><iper

my JAPH: print"Just another Perl hacker\n"; # ^ look, no space! pretty tricky huh?

In reply to Perl script to handle requests to a http://.../path/* by xiper

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.