I’m moving my WordPress driven site from a shared hosting account to my UKFast account
and I’m having trouble getting the site replicated on the new server due to the relative
URLs I’m using.
My URLs have to be in the format below:
This then reads the public_html folder.
I am using cPanel on an Apache server if that helps.
If I change image URLs in my stylesheet from
/wp-content/themes/themename/images/image.jpg to
~username/wp-content/themes/themename/images/image.jpg then it all works. Problem is I
don’t want to have to go in and remove all entries of ~username/ from image and file URLs
when I’ve switched the DNS settings and the new server is the active one.
There’s a WP Setting in your wp-config.php called WP_CONTENT_DIR. You can setup your Base URL http://ipaddress/~username/ there.
Further information here.