How to redirect old URLs to new Routes

Question

Hi,

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

Answer ( 1 )

    0
    2023-01-25T11:51:59+00:00
    This answer was edited.

    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.

Leave an answer