Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SarahS's avatar
Level 12

Move vb.net site to PHP

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.

0 likes
3 replies
ellgreen's avatar
ellgreen
Best Answer
Level 5

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));
tykus's avatar

You can configure permanent redirects in your web server config, e.g. permanantly redirecting any URL ending with .aspx to the same (without .aspx) in nginx would be something like the following (not tested):

rewrite ^/(.*)\.aspx$ / permanent;
SarahS's avatar
Level 12

Thanks, I think I will have limited ability on the server so redirects in laravel would be useful.

Please or to participate in this conversation.