Take advantage of redirect action results in ASP.NET Core MVC to elegantly redirect a request to a specified URL ASP.NET Core is a cross-platform, open source, lean, fast, and modular framework for ...
Then you can add a redirect for the old URL with the full path so that it redirects back to the main hostname. As for specifically how to do that in whatever server software you are using, that is ...