0

I have an ASP.NET MVC web app running on Azure as generic-site.co. It's a white-label site that supports a number of subdomains: acme.generic-site.co, globex.generic-site.co, initech.generic-site.co, etc. Browsing to each of them changes branding on the pages, but the underlying functionality is exactly the same.

Meanwhile I have an external domain name acme-site.com hosted by GoDaddy. I want to redirect this specifically to the acme.generic-site.co subdomain, but I also want to maintain acme-site.com as the root URL for any further browsing on that site, allowing users to have a pure acme experience without any indication of the underlying generic-site-ness.

I've tried to do this using GoDaddy's Domain Forwarding with masking, but I ran into CSRF issues almost immediately.

Is there any way I can achieve this? I suspect IIS URL rewriting might be helpful, but I'm at a loss as to how to proceed.

Gary Chapman
  • 418
  • 9
  • 20

2 Answers2

0

Don't use Domain Forwarding with masking.
Just add custom domain acme-site.com to Azure Web App.

And you may need to do one of the following:

  • Add a middleware or something that change Host in HTTP request header from acme.generic-site.co to acme-site.com.
  • Adjust the application to load correct branding when using domain acme-site.com.
qin
  • 1,627
  • 15
  • 22
0

It is probably easier to use IIS Url Rewrite module as you mentioned in your question. There are several examples on how to do this. Please start with this post by Scott Forsyth: https://weblogs.asp.net/owscott/iis-url-rewrite-redirect-multiple-domain-names-to-one

Kaushal Kumar Panday
  • 2,329
  • 13
  • 22