Skip to content

Commit

Permalink
Use 301 redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Feb 20, 2024
1 parent a9f1b3c commit 74383a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/system/sef/src/Extension/Sef.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ public function enforceTrailingSlash(&$router, &$uri)
if ($this->params->get('trailingslash') == 1 && substr($originalUri->getPath(), -1) == '/' && $originalUri->toString() != Uri::root()) {
// Remove trailingslash
$originalUri->setPath(substr($originalUri->getPath(), 0, -1));
$this->app->redirect($originalUri->toString());
$this->app->redirect($originalUri->toString(), 301);
} elseif ($this->params->get('trailingslash') == 2 && substr($originalUri->getPath(), -1) != '/') {
// Add trailingslash
$originalUri->setPath($originalUri->getPath() . '/');
$this->app->redirect($originalUri->toString());
$this->app->redirect($originalUri->toString(), 301);
}
}

Expand Down

0 comments on commit 74383a3

Please sign in to comment.