5
votes

I have our website on an Azure Web App plan at www.domain.com. This website is running an MVC 4 application and is working great. I have started to configure a blog on another azure website in my plan and would like it to be at the URL www.domain.com/blog instead of a blog.domain.com subdomain.

How do I accomplish this? Do I need to do some clever DNS settings? I'm unsure of the best technique that will also not screw around with the MVC website on the root.

2

2 Answers

2
votes

You can set rules in your main www.domain.com IIS server to rewrite /blog requests to another domain-blog.azurewebsites.net Azure App Service.

Something like this:

<rule name="Rewrite to blog site" stopProcessing="true">
      <match url="^blog$" />
      <action type="Rewrite" url="https://domain-blog.azurewebsites.net/{R:0}" />
</rule>

Take a look at this article https://tomssl.com/2015/06/15/create-your-own-free-reverse-proxy-with-azure-web-apps/

2
votes

Another option is to deploy two site under the same web app, an create virtual directory to separate them. See details about virtual directory in this link https://stackoverflow.com/a/15122761/5463877