0

Hi my Wordpress site hosted on WP Engine is wrongly redirecting to either the homepage or the prod site (mysitelive.wpengine.com). I use sucuri fire wall and wp rocket, but have tried every combination of clearing caches / deactivating plugins. Where could this 302 redirect be coming from?

$ curl -kILH "host: example.com" http://00.00.00.00/badredirectpage HTTP/1.1 302 Object moved Location: https://example.com/badredirectpage Content-Length: 74 Content-Type: text/html

HTTP/2 500 server: nginx date: Thu, 03 Feb 2022 21:03:04 GMT

2
  • 1
    If you don't know how to fix this, msg in to WPEngine support and ask them to fix. Their team is great and this is what you pay them for.
    – rudtek
    Feb 3, 2022 at 23:59
  • Been trying to figure this out with them for a couple days!
    – Danp
    Feb 4, 2022 at 17:10

1 Answer 1

0

There are quite a few places, plugins, tools, etc that can cause re-directs, not to even consider custom code.

If you think the re-direct is in your database and you are comfortable with wp-cli then you can use this command:

wp search-replace '00.00.00.00' 'example.com' --dry-run

This will tell you where the data you're searching for is located. Remove --dry-run and wp-cli will actually make the change.

If its NOT in the database, you need to look in your wp-config file, disable plugins and check for any custom code (functions.php for themes and child themes etc) to see if there is a piece of code forcing a redirect.)

You could try searching for it with SSH within files by using grep:

grep -rH "00.00.00.00"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.