How to redirect old URLs to new Routes

Asked by: boon
Date:
Viewed: 352
Answers: 1
  • 0

Hi,

I’m building a new site with Laravel to replace my old one. How can I redirect old URLs to the new ones?

Answers

Answer by: ChristianKovats

Answered on: 25 Jan 2023

  • 0

You can do it with routes.

For example, if your old page was yoursite.com/articles 

and the new page is yoursite.com/blog do it like this:

Route::redirect('/articles', '/blog', 301);

 

You should keep these redirects for at least a year according to Google.

Please log in to post an answer!