apacheperlmason

Processing paths that start with a dot using Mason dhandler


How can I make a Mason dhandler process a URL whose path section starts with .?

For example, if I have a dhandler file in my web root, the dhandler is triggered if I navigate to

`http://www.example.com/hello`

but I get a 404 if I navigate to http://www.example.com/.hello.

I am using Mason in combination with Apache and I have verified that this is not an Apache configuration issue forbidding paths that start with dot.


Solution

  • You're probably mean HTML::Mason and not the new(er) Mason.

    While I haven't installed Apache, but it is simple to create an PSGI test-case using HTML::Mason::PSGIHandler, like such app.psgi

    use 5.014;
    use warnings;
    use HTML::Mason::PSGIHandler;
    
    my $h = HTML::Mason::PSGIHandler->new(
        comp_root => $ENV{HOME}.'/tmp/mas/comps',
    );
    
    my $app = sub {
        my $env = shift;
        $h->handle_psgi($env);
    };
    

    and an very simple dhandler

    <pre>
    =<% $m->dhandler_arg %>=
    </pre>
    

    after running plackup and pointing my browser to http://localhost:5000/.hello it shows

    enter image description here

    so, the HTML::Mason hasn't any limitations on processing paths with dots.

    If you need more help, edit your question and add relevant parts of your apache config, htaccess, and your handlers how do you invoke the HTML::Mason.