sumitgroup's avatar

How to redirect Old-URL to New-URL in Laravel 6?

I just change my website all url's and now my old url is showing on google index. When i am searching any keyword then my previous links are showing there. suppose my old url is https://example.com/elans-town-commercial-project-for-sale and now new url is https://example.com/elans-town-for-sale. Please let mw know how i can permanent redirect my all urls to new urls. Because i don't want to remove my old URL's by google webmaster tools.

0 likes
3 replies
mabdullahsari's avatar

You can't force it to re-index. You have to wait until Google re-indexes that page again. The best thing you can do is placing a redirect to the new URL with HTTP status "Moved Permanently".

Also, this is the reason why permalinks exist, by the way...

return redirect()->route('routeName', $params, \Illuminate\Http\Response::HTTP_MOVED_PERMANENTLY);

Updated answer

1 like

Please or to participate in this conversation.