Reputation: 1708
Right now I have a traditional static HTML site (generated by Jekyll, FWIW) with assets being served by an old-school Apache server.
I am keen to migrate this to an Azure static site stored in blob form and delivered via the CDN for improved performance.
The trouble is that I have an .htaccess file that handles several 301 redirects for me to maintain links to old popular pages that have moved. I'm not sure how to replicate this functionality on Azure short of running my own full LAMP stack with an Apache server in a VM just to perform this rudimentary function.
Is my only option to pay the $10 or so per month needed to setup an IIS instance to do the redirects for me (via IIS's mod_rewrite importer)? I believe this is what Azure refers to as simply their "shared website" product.
I would prefer a cheap and simple solution that doesn't require the cost and technical overkill of a full VM and just bills me for the bandwidth. Is there some Azure URL redirect feature somewhere that I'm missing? Any other clever solution anyone can think of?
Upvotes: 1
Views: 2349
Reputation: 9182
In Azure Websites, you can do 301 redirects using a web.config
file,
See Using web.config file for redirect for sample web.config
:
<configuration>
<location path="oldPage1.htm">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.newDomain.com/newPage1.htm" httpResponseStatus="Permanent" />
</system.webServer>
</location>
<location path="oldPage2.htm">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.newDomain.com/newPage2.htm" httpResponseStatus="Permanent" />
</system.webServer>
</location>
<!-- etc. -->
</configuration>
Upvotes: 1