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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to