Question

User Directories Map To Ip Address Not Domain Name

Posted August 17, 2016 2.2k views
Apache PHP DigitalOcean DNS IPv6 Ubuntu 16.04

I recently updated my Domain name from my ip address to a domain I purchased on NameCheap. I had previously had user web directories set up and they would map to myIpAddress.com/~userName/file. If it I type in my new domain name it works, but I get a cross-origin No Access Allow Control Origin error in my console. Also, when I click a link it automatically maps to my ip address, not the new domain name. I’m using Wordpress as development. I want my links to map to the Domain Name not the IP Address and I’ve tried adding ‘Header set Access-Control-Allow-Origin “*” to my userdir.conf file in Apache2, but no dice(Yes, I’ve restarted apache). Side note, I do not get the error when I’m loading my IP Address and the user web directories as the URL.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers

When switching from using the IP address to using your domain did you update the Site URL in your WordPress settings? If not, then WordPress would continue to return links using your IP address and may redirect back to the IP address as well. Log into /wp-admin and change these settings and the issues you’re running into should be resolved.

Submit an Answer