Search code examples
azureazure-static-website-hosting

How to create a pure redirect HTTP site under Azure?


I have a static website foo.example.com that contains a list of pages (several hundreds). I want to migrate this website to another static website, as subfolder www.example.com/foo. At this point, I have a list of URLs from foo.example.com and their associated URLs under www.example.com/foo. The mapping is irregular and accidental. There is no regex possible to rewrite the old URLs into the new ones, it has to be hard-coded.

I am seeking a service available under Azure to "bind" those old URLs with HTTP redirects pointing to the new URLs. Ideally, I would be looking to a serverless solution, or even better a fully static solution. What would work in this case? I am looking for something as maintainable as possible as the original list of URLs will not change in the future.


Solution

  • Azure Front Door would be your best here if you are willing to move the current www.example.com website behind Front Door as well.

    With this, you can define URL Rewrite rules to rewrite /foo requests to go to foo.example.com (or the corresponding backend).