OSDN Git Service

Controller::Rediect: fix tag page url
authorhylom <hylom@users.osdn.me>
Fri, 7 Jun 2019 17:27:31 +0000 (17:27 +0000)
committerhylom <hylom@users.osdn.me>
Fri, 7 Jun 2019 17:27:31 +0000 (17:27 +0000)
src/newslash_web/lib/Newslash/Web/Controller/Redirect.pm

index b118803..39b635a 100644 (file)
@@ -66,7 +66,7 @@ sub _redirect_by_view {
            my $tag = $c->model('tags')->select_tagnames(tagname => $filter);
            if ($tag) {
                $c->res->code(301);
-               $c->redirect_to("/tags/$filter");
+               $c->redirect_to("/tag/$filter");
                return;
            }
        }
@@ -163,7 +163,7 @@ sub index {
        my $tag = $c->model('tags')->select_tagnames(tagname => $filter);
        if ($tag) {
            $c->res->code(301);
-           $c->redirect_to("/tags/$filter");
+           $c->redirect_to("/tag/$filter");
            return;
        }
     }
@@ -172,12 +172,12 @@ sub index {
     if ($section) {
        if ($section eq 'mac') {
            $c->res->code(301);
-           $c->redirect_to("/tags/apple");
+           $c->redirect_to("/tag/apple");
            return;
        }
        if (any { $section eq $_ } @sections) {
            $c->res->code(301);
-           $c->redirect_to("/tags/$section");
+           $c->redirect_to("/tag/$section");
            return;
        }
        $c->render('Not found', status => '404');