djboz
By:
djboz

User Directories Map To Ip Address Not Domain Name

August 17, 2016 920 views
PHP Apache DigitalOcean IPv6 DNS 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.

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.

Have another answer? Share your knowledge.