Fixed typo affecting JS-detection on the production site.
[MyWeb.git] / Redirect.pm
index 25cbfb5..bff6fb9 100644 (file)
@@ -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;