Yes, that can be done in your routes file like so:
Route::permanentRedirect('/contact.aspx', '/contact');
Could do this if you had quite a few that you wanted to redirect:
Route::any('{page}.aspx', fn($page) => redirect($page, 301));
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I need to move an old vb.net site to PHP because I have pretty much forgotten all .net and I don't want to get into it again (I'm trying to focus on just PHP).
So, my question is regarding the old pages, can I, in the routes/web.php, have a list of all the old pages e.g. contact.aspx and repoint them to the new ones? Does it work like that? Will that be a permanent redirect (301)?
Thanks.
Yes, that can be done in your routes file like so:
Route::permanentRedirect('/contact.aspx', '/contact');
Could do this if you had quite a few that you wanted to redirect:
Route::any('{page}.aspx', fn($page) => redirect($page, 301));
Please or to participate in this conversation.