0
votes

I have a multi-tenant web app in Azure that uses subdomains to select the proper user.

Ex:

user1.mydomain.com user2.mydomain.com etc.

Everything works fine except when a user decides to enter 'www' in front of their url. My app will support this and redirect them to the proper URL but I can't seem to setup the custom domains on the web app to let the request even hit the app. When they try to enter their url with www, they get the normal Azure 404 Web App not found page.

I currently have a custom domain setup in Azure pointing for *.mydomain.com.

How do I need to setup my custom domain in Azure so that it lets www.*.mydomain.com connect?

2
I don't think www.*.mydomain.com is a valid domain name. Do you meant to say www.mydomain.com?Win
@Win it is perfectly valid - see section 2.2.1 of RFC 4592Michael B
Although www.mydomain.co.uk is valid, I don't think you can buy www.*.whateveriwant.uk.Win
@Win you buy example.com, and then configure DNS with a www.* record. It is simply a subdomain as far as DNS is concerned.Michael B
@MichaelB I see. Thank you for the clarification.Win

2 Answers

1
votes

The problem you have here is simply that Azure doesn't support this configuration. There is a feedback request but as of yet, it is still under review.

Your only solution would be to move to an IaaS solution, or to another provider (I'm not sure if AWS does)

You could perhaps configure a HTTP redirect, so www.*.example.com goes to a different server that strips off the www and redirects it to your servers.

0
votes

Have you tried using a CNAME address in DNS?

You could have the cname "www.*.whatever.uk would map to *.whatever.uk. This way when the user enters the extra www, DNS will redirect it to your standard url.