funkhaus / fuxt-backend

A theme that turns WordPress into a true Headless CMS. Optimized for the fuxt frontend boilerplate and fuxt-api plugin.
GNU General Public License v3.0
101 stars 19 forks source link

Admin URL redirecting when moving to WP Engine #79

Open drewbaker opened 8 months ago

drewbaker commented 8 months ago

We are trying to migrate a bunch of sites to WP Engine, and after the migration happens, if you try to access the admin URL, it redirects to the live site admin that is on Flywheel.

For example, the WP Engine dashboard links to: https://my.wpengine.com/installs/2738612/launch_wp_admin?account_id={some token here}

But it ends up at: https://api.makemakeentertainment.com/index.php?install_name=makemakeent&nonce={some token here}&rest_route=%2Fwpe_sign_on_plugin%2Fv1%2Flogin&user_email=drew%40funkhaus.us&x_request_id={some token here}

drewbaker commented 8 months ago

So the question is, what code do we have in our theme that is redirecting to a the admin URL?

drewbaker commented 8 months ago

The page that you end up on is JSON and says this:

{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}
drewbaker commented 8 months ago

The solution is to do a find-and-replace on the database to update old URLs. The important ones to change are the settings for siteurl and homeurl, but ideally all the ones in the database (like those used in post content to link to an image).