• Have a site up on it’s own domain, downloaded the files & database, then setup locally on xampp. Followed the directions here, which after some fiddling finally was able to get to load the index page correctly, including all articles etc.

    (Have previously migrated sites from web to localhost & vice-versa, but don’t recall experiencing these issues.)

    Problem now is when clicking any of the internal links (pages, or article pages) returns 404. When hovering over the link, the URL looks correct. The URL for those pages in the ‘edit page’ section in the admin area looks correct. Clicking ‘view page’ in the admin ‘edit page’ section also returns 404.

Viewing 4 replies - 1 through 4 (of 4 total)
  • First of all, fire update queries at your local phpmyadmin. These queries are fired to update your page links, post links etc. You can find the queries here.
    https://howlmedia.co.za/how-to-make-a-wordpress-site-live/.
    Note: Queries in the link takes site from local to live. Just reverse the queries to make it from live to local.
    After that update your permalink settings at the backend.
    This should do.

    Hope that helps!

    Thread Starter CiderJack

    (@ciderjack)

    That doesn’t seem to work.

    After submitting the queries, PHPmyAdmin didn’t return any sort of the usual message of a successful edit or errors, instead just saying ‘Switch to visual builder’.

    I think some steps were missed while you configured your site on local. I would like to check this link out & try it carefully. This should do it:
    https://howlmedia.co.za/how-to-make-a-wordpress-site-live/

    Note: The queries should be reverse & it should be:
    Query 1:
    * UPDATE wp_options SET option_value = replace(option_value, ‘www.yoursite.co.za’,‘localhost/yoursite’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

    Query 2:
    * UPDATE wp_posts SET guid = replace(guid, ‘www.yoursite.co.za’,‘localhost/yoursite’);

    Query 3:
    * UPDATE wp_posts SET post_content = replace(post_content, ‘www.yoursite.co.za’,‘localhost/yoursite’);

    After that don’t forget to update your premalink settings.

    Hope that helps!

    Thread Starter CiderJack

    (@ciderjack)

    No steps were missed. I have even taken the time to repeat the entire migration process from the beginning. (I have successfully migrated sites between localhost & hosted ‘live’ server (both directions) probably a dozen times and have never run into this specific issue. So while clearly not an expert, I am acquainted with the process)

    Also, I realized the queries suggested by the tutorial needed to each be run from the individual tables’ ‘SQL’ tab, not from the main database ‘Queries’ tab. (This is why there was no feedback of success or error previously.)

    Thankyou for your help, but the links (still showing the correct (new) URL when hovered over as noted above) continue to load a ‘Object not found! Error 404’ page, and the URL of the page with the error is the correct URL that should have the content of the page, but does not.

    Anybody else have any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘after migrating site to localhost, getting 404 on internal links’ is closed to new replies.