perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Galbavy" <peter.galb...@photasmagoria.com>
Subject Re: Config question
Date Mon, 13 Oct 2003 12:21:31 GMT
Fagyal, Csongor wrote:
> I would like to map all incoming requests of a virtualhost to the same
> ASP file. Is there a way I can do this without using mod_rewrite?
> So I need
> http://domain/whatever/andanythingelse
> http://domain/whatever/hello.xyz?zoh=zoh
> call the same
> $documentroot/index.asp
> which should be able to access the URI (in the original form).
>
> Is this possible? How?

In my config, I map a specific pattern through to an ASP, but you could just
match anything:

httpd.conf:

PerlTransHandler Some::Redirect;

startup.pl:

...
package Some::Redirect;

use Apache::Constants qw(:common);

sub handler
{
        my $r = shift;

        # match 16 hex digits (hand edited for e-mail example)
        if ($r->is_initial_req && $r->uri =~ m|^/([\da-f]{16})?$|) {
                if ($r->args) {
                        $r->args($r->args . "&ref=$1");
                } else {
                        $r->args("ref=$1");
                }
                $r->uri("/something.asp");
        }

        return DECLINED;
}


Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message