• So currently I have a webhosting on godaddy called:

    https://www.oldwebsite.com

    I purchased a new domain (newdomain.com) from another company, who won’t let me switch that domain to Godaddy for at least 60 days. So my best bet is to redirect the newdomain url to the current oldwebsite.com

    Godaddy created a new PRIMARY domain called newdomain.com on their hosting, however this is not linked to anything at the moment.

    For some reason, when newdomain.com was made the PRIMARY domain on GoDaddy, wordpress started giving problems.

    Problem 1:
    I was locked out of wordpress, so I went into wp-config.php and entered:
    define(‘WP_HOME’,’https://www.oldwebsite.com’);
    define(‘WP_SITEURL’,’https://www.oldwebsite.com’);
    Problem 1 solved.

    Problem 2: Some of the pictures on my website are not loading. When I checked the url for the pictures, it points to:
    newdomain/wp-content/uploads/2013/12/Logo3.png

    How do I get these images to point back to oldwebsite/wp-content/uploads/2013/12/Logo3.png??

    Thank you guys. Your help is much appreciated!

    Best,
    Andy

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter gurkhas

    (@gurkhas)

    Incase anyone thinks the solution is: changing the PRIMARY domain on Godaddy back to oldwebsite.com …

    …you are probably right. But Godaddy won’t let me change the PRIMARY domain back to something that already exists – you have to create a NEW primary domain (which doesn’t solve the problem) or delete the current oldwebsite.com first (which I don’t want to do as I’m worried it may delete my files).

    Just a thought.

    Go to your database and look for table called “wp_options” and change value of following
    1- site_url
    2- home

    I hope it should fix the problem

    Thread Starter gurkhas

    (@gurkhas)

    Mohamed Asfer

    Thank you for the help.

    I have changed 1-site_url and there is no 2- home option.

    However, this has not solved the problem.

    Thread Starter gurkhas

    (@gurkhas)

    I’ve solved the problem. Here is what I did for newbies:

    Basically, my theme settings page had my logo displayed using the newdomain.com/… urls. I changed these to the old ones and my website logos appeared. The bigger issue is that my website links are all also pointing to the newdomain.com

    To solve this, I downloaded a plugin called: search & replace to replace all the newdomain.com to oldwebsite.com. This searches directly into your database and changed the url strings from various posts, including wp_posts and wp_postmeta. There were some files it couldn’t change, so I had to log into PHPMyDomain and do it manually, but this can take a while if there are many files. Luckily, the Search & Replace plugin tells you which table and which field (ID No) so you can easily find the value that needs changing.

    Always make sure you backup your database first. I used PHPMYAdmin to export the database as an SQL file first.

    Hope this helps.

    Best,
    Andy

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress linked to incorrect domain for images’ is closed to new replies.