X-Git-Url: http://git.jankratochvil.net/?p=MyWeb.git;a=blobdiff_plain;f=Redirect.pm;h=bff6fb96caba697bb49029c60201d09755665f30;hp=25cbfb51564cad0d3b7f432fe6ca43af612397b5;hb=78715c32e9d5fabc3a853f8b210a953bb315b6ee;hpb=3642e53fcbb31138ad82ab3ab18bc51234ff178d diff --git a/Redirect.pm b/Redirect.pm index 25cbfb5..bff6fb9 100644 --- a/Redirect.pm +++ b/Redirect.pm @@ -24,7 +24,7 @@ use strict; use warnings; use My::Web; -use Apache2::Const qw(HTTP_MOVED_TEMPORARILY); +use Apache2::Const qw(HTTP_MOVED_PERMANENTLY); our $HTML_TEST=0; @@ -32,14 +32,10 @@ our $HTML_TEST=0; sub handler { my $W=My::Web->init( - "header_only"=>1, "args_check"=>{ "location"=>'^\w+://', }, ); -$W->{"r"}->status(HTTP_MOVED_TEMPORARILY); -$W->{"r"}->headers_out()->{"Location"}=$W->{"args"}{"location"}; - -exit 0; +My::Web->http_moved($W->{"args"}{"location"},HTTP_MOVED_PERMANENTLY); } 1;