I've asked this on the mason mailing list too, but it seems to be dead.

I read the article at http://www.perl.com/pub/a/2004/04/01/masongal.html and installed http://search.cpan.org/dist/faceplant, and figured out enough to get it almost working. But I still can't figure something out.

A URL like <http://bkcg.lamp4/gallery/June> gives a 404, "The requested URL /gallery/June was not found on this server." A URL like <http://bkcg.lamp4/gallery/June/_MG_2571.JPG.html> works as expected.

The real directory docroot/gallery contains files autohandler.mason, dhandler.mason, and index.html, and subdirectories css, images, js, and pictures. index.html is just inherit => 'dhandler.mason' in flags. Everything with a URL under gallery is really made up by this script.

Meanwhile, <http://bkcg.lamp4/gallery> itself does not work either, but <http://bkcg.lamp4/gallery/index.html> does. Note that automatically finding the index.html file works on other locations. This offers a work-around for the top-level gallery, anyway.

Presumably this worked for him! I'd like to better understand what the deal is with directories vs locations in a directory when handled by a higher-level in the URI's name. And I need to know what is still wrong here.

Here is my configuration:

        # site-wide setting
	<LocationMatch "(\.html|\.txt)$">
	    SetHandler perl-script
	    PerlHandler HTML::Mason::ApacheHandler
	</LocationMatch>

        # all URI's here, will include names for graphics files + query args.
	<Location /gallery/images>
	    SetHandler perl-script
	    PerlHandler HTML::Mason::ApacheHandler
	</Location>

        # keep private stuff from being explicitly fetched
	<LocationMatch "(\.mason|dhandler|autohandler)$">
	    SetHandler perl-script
	    PerlInitHandler Apache::Constants::NOT_FOUND
	</LocationMatch>

In reply to Mason newbe question by John M. Dlugosz

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.