Same issue, different day - imported site redirects to live URL

I have seen a couple of tickets on this issue on the community board, but none of the suggestions have resolved it. When I attempted to visit or administer my locally imported site, it routes to the production/web/live version.

I have verified that there is no WP_HOME or WP_SITENAME settings in wp_config
I am unable to access the admin area of my local site so I cannot reset permalinks
I have cleared my browser cache as well
I have reviewed my hosts file to ensure that my sites appear and are defined as local
I would look at the .htaccess file but I don’t see it - I just read an article that implies it may not be used by Local anyway.

I’m a newb so I don’t know what I don’t know in this. Any assistance you can provide is greatly appreciated.
Thanks!

Hey there!

It sounds like some occurrences of the old domain wasn’t changed. To fix this I would recommend running search-replace with WP-CLI.

Here’s how you can run the search and replace with WP-CLI in Local:

  1. Right-click on the site in Local
  2. Go to ‘Open Site SSH’
  3. Enter wp search-replace '//olddomain.com' '//newdomain.com' (olddomain.com being your live Flywheel domain and newdomain.com being your Local site domain)
  4. Done!

If this doesn’t work you might also want to try visiting the site in incognito mode. Let us know if you are still having issues!

Keegan

This solved my redirection issue - I am now having problems where my themes are erroring because PHP version has caused some of the code to error. Sooo … upward and onward, but at least I’m looking at the correct site.
Thanks!