WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] After update DB, home link on local redirects to live site (3 posts)

  1. kanika
    Member
    Posted 1 year ago #

    A related problem:

    When I type http://localhost/myblog I get redirected to the live site on production server.(I have made the changes in the wordpress)

    When I type http://localhost/myblog/wp-admin, it goes correctly to the local site's admin interface.

    Again from the admin interface, I can't navigate to the local site cause it takes me to the production site.

    Strange behaviour.

    The changes I made:
    UPDATE wp_options SET option_value = 'http://localhost/myblog' WHERE option_value = 'http://www.example.com';
    The permalink settings are as follows(default . does that matter?)
    http://localhost/myblog/?p=123

  2. Marventus
    Member
    Posted 1 year ago #

    Hi.
    You are experiencing that problem because you need to use a search for your live site domain, say yoursite.com, and replace it with localhost/yoursite in your local database.
    That should fix the problem for you. If you are not very familiar with SQL queries or phpMyAdmin, you can use the Search and Replace plugin, which has a built-in sandbox feature.
    Cheers!

  3. kanika
    Member
    Posted 1 year ago #

    Thank you.
    Some links in the wp_options table were still to the live site.
    For general info:
    Its not just the 'home' record and the 'siteurl' record that needs to be changed, every instance of the live site url should be changed including the paths to images, that is if iamges exist on localhost.

    Thanks again,
    Kanika.

Topic Closed

This topic has been closed to new replies.

About this Topic