DEV Community

Cover image for Add a custom domain to your WordPress website
Foteini Savvidou
Foteini Savvidou

Posted on

Add a custom domain to your WordPress website

Originally published at www.foteinisavvidou.codes

In the previous tutorials, you created and configured a WordPress website hosted on Microsoft Azure, updated the version of PHP and connected to your app using FTP. In this tutorial, you will learn how to map a custom domain name to your website by using a CNAME record.

To complete the exercise, you will need:

  • An Azure subscription.
  • A WordPress website running on Azure or another Azure App Service app.
  • Purchase a domain name and make sure that you have access to the DNS records for your domain provider.

Check the pricing tier of the App Service plan

App Service Free hosting plan does not support custom domains. To connect a custom DNS name to your app, the app’s App Service plan must be a paid tier.

  1. Sign in to Azure Portal, expand the left navigation panel and select All resources.
  2. Select the App Service that you have created in the part 1.
  3. In the left pane, select Scale Up (App Service Plan) in the Settings section.
  4. If the app is in the F1 tier, select one of the non-free tiers and click Apply. If your app isn’t in the F1 tier, skip this step.

Connect your domain

You can use either an A record or a CNAME record to map a custom DNS name to your App Service. In this tutorial, you are going to add a CNAME record for the www subdomain.

  1. In the left pane, select Custom domains under Settings.
  2. Select Add Custom Domain. Add custom domain
  3. Type the domain name (www.your-domain.com), make sure that Hostname Record Type is set to CNAME and click Validate. Add custom domain
  4. To verify domain ownership, create a CNAME and a TXT record in your DNS provider using the following configuration: Validate ownership
  5. Select Validate again. If the previous step is done correctly, you will see a green checkmark next to domain ownership. This means that you have successfully confirmed your domain ownership.
  6. Select Add Custom Domain. Add custom domain

Next steps

In the last tutorial of the “Host WordPress on Microsoft Azure” tutorial series, you will learn how to add an SSL certificate to your website using free App Service Managed Certificate. Stay tuned!

Top comments (0)