Home Redirect from non www to www, do I need two app services in azure?
Reply: 2

Redirect from non www to www, do I need two app services in azure?

Irfan Yusanif
1#
Irfan Yusanif Published in 2018-02-11 11:55:12Z

I'm using this solution in redirecting my domain from non www to www. I'm using azure for hosting.

I have created app service for www.domain.com

when I try to access domain.com I get this error:

Should I have to create two app services one for domain.com and one for www.domain.com? or is there a way to accomplish this using one app service?

Gaurav Mantri
2#
Gaurav Mantri Reply to 2018-02-11 12:58:48Z

Should I have to create two app services one for domain.com and one for www.domain.com? or is there a way to accomplish this using one app service?

No, you don't need two app services to accomplish this.

Assuming you have configured domain mapping correctly in your DNS provider (e.g. GoDaddy), all you need to do is add both www.domain.com and domain.com in the Hostname mapping in Custom DNS section for your Web App in Azure Portal.

Muhammad Zaheer Nazir
3#
Muhammad Zaheer Nazir Reply to 2018-02-12 16:37:09Z

All you need to do it set it up in the DNS section of your domain provider and add custom domains in App Service in Azure Portal as well:

Type   Name    Value
A      @       Ip Address of your App Service ( this will cover your main domain )
TXT    @       yourwebsite.azurewebsites.net ( this will cover your main domain )
CNAME  www     yourwebsite.azurewebsites.net ( this will conver www section)

Now in the app service side you need to add the custom bindings.

Go to Azure Portal | App Service | settings | custom domains | add host name as below

yourdomain.com 

Now you have both domain pointing to same App Service. More info on step by step guide, I have prepared a post for custom domain check it out.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 1.150084 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO