"Consistency in URL Display: Managing WordPress with Azure VM and Custom Domain"

syed 40 Reputation points
2024-03-18T22:53:08.0366667+00:00

"After setting up a virtual machine in Azure and installing WordPress, I received a default IP address. Subsequently, I purchased a domain from GoDaddy and configured a DNS record in Azure using this IP address. Currently, I can access my website via both the IP address and the custom domain name. However, there's a discrepancy in the URL section: when accessing the website through the IP address, the URL displays the IP, and when using the custom domain name, it displays the domain. Interestingly, any changes made to the custom domain name also reflect on the IP address. Despite the content being the same, the URLs differ. How can I ensure consistency in the URL display?"

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,091 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,136 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 74,881 Reputation points
    2024-03-19T06:58:47.9066667+00:00

    Hi,

    What I would recommend is you configure Sender Name Indication (SNI) inside of the VM so that your WordPress only receives and responds to requests that come in for your custom domain name (www.yoursite.com)

    In this way if someone (e.g. googlebot) browses to your website using the IP address they will not see same website content when using the IP address. If you let me know what operating system and web server (NGINX?), you are running in your VM I can point you in the right direction in terms of configuring SNI.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


0 additional answers

Sort by: Most helpful