diff --git a/Modules/Page/Http/Controllers/PublicController.php b/Modules/Page/Http/Controllers/PublicController.php index d7b2cf693..7c23ef337 100644 --- a/Modules/Page/Http/Controllers/PublicController.php +++ b/Modules/Page/Http/Controllers/PublicController.php @@ -38,6 +38,12 @@ public function uri($slug) $this->throw404IfNotFound($page); + $currentTranslatedPage = $page->getTranslation(locale()); + if ($slug !== $currentTranslatedPage->slug) { + + return redirect()->to($currentTranslatedPage->locale . '/' . $currentTranslatedPage->slug, 301); + } + $template = $this->getTemplateForPage($page); return view($template, compact('page'));