X-Git-Url: https://git.jankratochvil.net/?p=MyWeb.git;a=blobdiff_plain;f=Redirect.pm;h=0c0654ac7e91112fd73865e6956538d44923b9db;hp=25cbfb51564cad0d3b7f432fe6ca43af612397b5;hb=f9da4afb617190969832c76df4a2642d9ad7accf;hpb=a4810954a0bfff7b3d35c4d45b12f740b0ed661e diff --git a/Redirect.pm b/Redirect.pm index 25cbfb5..0c0654a 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,11 @@ 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); +die "NOTREACHED"; } 1;