Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove/disable mywebsite.azurewebsites.net domain after adding custom domain?

I have created a website on Azure, and linked it with custom domain name(CNET).

Now, when I look at domains on website configuration on Azure panel I see both www.mywebsite.com , and default mywebsite.azurewebsites.net. Both of these domains work fine and I can access website using any of these.

How can I remove mywebsite.azurewebsites.net domain? Does having both of these domains affect SEO?

EDIT*
Thanks for answers, I am trying to enable a 301 redirect, but it is not working. I have added this to web.config file ("example" being my actual site name)

<system.webServer>
<rewrite>
  <rules>
    <rule name="SEOAzureRewrite" stopProcessing="true">
      <match url=".*" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^example.azurewebsites.net$" />
      </conditions>
      <action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>
</system.webServer>

I run the website but nothing happens. I can still access the mysite.azurewebsites.net address.

like image 986
Hovan Gourmet Avatar asked Oct 19 '22 17:10

Hovan Gourmet


1 Answers

there is no problem in having both domains pointing to your website.

for SEO, you must do 301 redirect from mywebsite.azurewebsites.net to www.mywebsite.com.

It has to be 301 redirect. As this will tell the search engines to always index www.mywebsite.com

like image 189
M. Ali Iftikhar Avatar answered Oct 22 '22 21:10

M. Ali Iftikhar