skip to Main Content

Hope this is an easy one… 8^)

I was provided a complete WP site and DB by a client, and need to see what’s in there, so I’m trying to run it using MAMP. I’ve worked with MAMP successfully before, and done a bit of basic DB manipulation, but I can’t figure out what’s wrong here.

I put the WP install into a folder called (for our purposes here) "originalsiteurl.com" in my local root folder, alongside other sites I’ve successfully installed on my Mac with MAMP. Then I imported the database backup into a new DB, edited the wp_options table to change the site and WP URL, and ran a search-and-replace tool to change all references to http://originalsite.com to http://localhost/originalsiteurl.com . Updated wp-config, and… the homepage works!

But when I click on any other link, it returns an error:

Not Found
The requested URL /index.php was not found on this server.

So I redid the DB import, this time just changing the two options in wp_options and doing nothing else. Same result – homepage loads fine, all other pages are a no go.

DB stuff can be daunting but I’ve had previous good luck with making changes and getting things working – so I’m just stumped as to what to do here, or why this specific error is coming up (why is it referring to index.php?)

Hope someone can help. Thanks!

2

Answers


  1. Chosen as BEST ANSWER

    Sorry, it was just a matter of going to Settings --> Permalinks and re-saving. Voila!

    Should have checked the "suggested answers" as this was mentioned in one of them. Sorry for the duplication.


  2. Check In Database, in table "wp_options"
    site_url and home is updated. if not then you can update it directly

    or

    with the following query , make sure that you replace example.com with your live site’s URL and http://localhost/mylocalsite with the local server URL of your site.

    UPDATE wp_options SET option_value = replace(option_value, 'https://www.example.com', 'http://localhost/mylocalsite') WHERE option_name = 'home' OR option_name = 'siteurl';
      
    UPDATE wp_posts SET post_content = replace(post_content, 'https://www.example.com', 'http://localhost/mylocalsite');
      
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://www.example.com','http://localhost/mylocalsite');
    

    and also reset permalink in admin panel through the following path

    Reset Permalinks ( Dashboard >> Settings >> Permalinks )
    

    Make sure menu path in ‘header.php’ is not static , otherwise need to change that path too

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search