Ajout de redirections post MEP oubliés par Sylvain

This commit is contained in:
Jérémy Munsch 2024-03-14 15:42:11 +01:00
parent 45e298f2a9
commit 3fef79fa72
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -6,9 +6,7 @@ use App\Http\Controllers\Fo\NewsController;
use App\Http\Controllers\Fo\StaticPageController;
use Illuminate\Support\Facades\Route;
Route::middleware(['throttle:web'])
->name('fo.')
->group(function () {
Route::middleware(['throttle:web'])->name('fo.')->group(function () {
Route::middleware(['local-development'])->group(function () {
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
});
@ -45,4 +43,22 @@ Route::middleware(['throttle:web'])
Route::get('/news', [NewsController::class, 'index'])->name('news.index');
Route::get('/news/filtered', [NewsController::class, 'newsFiltered'])->name('news.filtered');
Route::get('/news/{slug}', [NewsController::class, 'show'])->name('news.show');
});
// * Redirections suite à la MEP
$redirections = [
'mail/to/commercial' => 'contact',
'rubrique/contact' => 'contact',
'rubrique/plan-d-acces' => 'contact',
'rubrique/service-consommateurs' => 'contact',
'rubrique/nos-savoir-faire' => 'gammes',
'mentions' => 'mentions-legales',
'actualite/{any}' => 'news',
'rubrique/nos-engagements' => 'nos-convictions',
'rubrique/la-societe' => 'nous-connaitre',
'rubrique/offres-d-emplois' => 'rejoignez-nous',
];
collect($redirections)->each(
fn (string $newPath, string $oldPath) =>
Route::redirect("/{$oldPath}", "/{$newPath}", 301)->name('redirect.' . str($oldPath)->slug())
);
});