Follow On Google News

Redirect .azurewebsite.net to custom domain

As you have launched your web app or WordPress website on Microsoft Azure and you have also added custom domain to it.

Why is it necessary to remove the azurewebsite.net url?

As you have launched your web app or WordPress website on Microsoft Azure and you have also added custom domain to it. Since you must have noticed that when you launch your web app or WordPress website on Azure, it will first launch on a default URL like ###.azurewebsite.net. Now even if you have installed a custom domain in your web app or WordPress, your website will be open on the custom domain as well as on that default URL ###.azurewebsite.net. I have explained in this article how to redirect .azurewebsite.net to custom domain.

Redirect .azurewebsite.net to custom domain

Since it is very important to solve this problem because if you have set custom domain, then your website should be open only on custom domain and not default . on azurewebsite.net.
Also, any activities you do on the custom domain, all those activities will be done with the default . Will also become automatic on azurewebsite.net. Doing so will result in duplicate content error, your website will not rank on any search engine. So it is very important to remove the default ###.azurewebsite.net.

How to remove or delete or redirect ###.azurewebsite.net

You should know that ###.azurewebsite.net cannot be deleted, it is redirected to custom domain only with the help of a rule. Adding a redirect rule will open all URLs containing ###.azurewebsite.net to URLs containing your custom domain.

To redirect the ###.azurewebsite.net URL to a custom domain, you need to add a rule to the web.config file, which requires opening the file manager of WordPress.

Since there are only two ways to open the file manager of WordPress launched on Azure. Either the file manager of WordPress can be opened with the help of a plugin or with the help of tools from Azure.

We recommend making changes to the coding of WordPress’s file manager using tools from Azure, as any coding errors can be corrected. But if you make changes to the coding of WordPress’ file manager via the plugin, and unfortunately, a coding error occurs, your website will instantly break. And if you don’t know how to open WordPress’s file manager using Azure’s tools, the only way is to delete that web app from Azure and launch WordPress from the app market again.

So first of all, with the help of Azure tools, open WordPress’s file manager, so that redirect rule can be added to web.config file.

For this, you automatically open the App service dashboard in Azure. There, in the Service Features bar on the left, click on “Advanced Tools” in the Development Tools section. Since the webpage that will open on clicking “Advance Tools” will look blank, but click on the “Go” link given there. On clicking, you will be redirected to the kudu service of Azure, where you will be able to open the file manager of WordPress.

When you will reach the kudu service dashboard, there you will be able to see the details and environment of your website. There you will see the “Debug console” menu at the top. It will have two submenus named CMD and Powershell. Click on “CMD” there and let the page open. Once that page is opened, you will see four files in it. Click on the “site” file at the bottom of it and let the page open. Now click on the “wwwroot” file at the bottom of it and let the page open. Now scroll down there and find web.config. Find web.config, then click on its edit button, so that you can edit the code of web.config. Once the web.config file is opened, you will see a rule already attached to it. Now you have to add one more rule, which is given below.

<rule name="Redirect requests from default Azure websites domain" stopProcessing="true"><match url="(.*)" /> <conditions logicalGrouping="MatchAny"><add input="{HTTP_HOST}" pattern="^abcd\.azurewebsites\.net$" /><add input="{HTTP_HOST}" pattern="^www\.ijklmnop\.in$" /></conditions><action type="Redirect" url="https://ijklmnop.in/{R:0}" appendQueryString="true" redirectType="Permanent" /></rule>

Instead of abcd in this rule code, write the prefix you added to your azurewebsites.net and instead of our domain, write your domain in the same format as it is written in it and save the whole rule code by adding it as shown in the picture below.

Redirect .azurewebsite.net to custom domain

After saving, now you open and check all your URLs with ###.azurewebsite.net. Now all URLs with ###.azurewebsite.net will open on the URL of your custom domain.

Conclusion

You have redirected your default URL of ###.azurewebsite.net to your custom domain with the help of this article. Since it was a very easy process but this process has to be completed very carefully, otherwise error may occur. If you face any issue while redirecting the default URL of ###.azurewebsite.net to your custom domain, then write it in the comment box below and also write how helpful this article was for you.

Able People Encourage Us By Donating : सामर्थ्यवान व्यक्ति हमें दान देकर उत्साहित करें।

Thanks for reading: Redirect .azurewebsite.net to custom domain, Please, share this article. If this article helped you, then you must write your feedback in the comment box.

Getting Info...

Post a Comment

Comment your feedback on this article!

Recently Published

10+ Foods To Improve Your Vision

आँखों की कमजोरी या कमज़ोरी के लक्षण कई लोगों को होने वाली सबसे आम दृष्टि समस्याएं हैं आंखों में दर्द, आंखों में पानी आना, पढ़ते समय आंखों में पानी आ…
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.