Local Redirecting to Live Site

Hey Aaron,

I take it this is a copy of the site from a live environment, there may be a few things lying around.

Have you checked if there is anything in a lurking .htaccess file?

If there isn’t one and you’re using NGNIX, if you’ve copied over the database there may be some cached data stored. A simple trick in the back end is to save the permalink structure twice.

While logged in to your local site via SSH you should be able to run the following WP CLI command -

wp rewrite structure '/%year%/%monthnum%/%postname%/'

You can replace ‘/%year%/%monthnum%/%postname%/’ with your own permalink structure found in the live site

Run the above command twice, then the following command.

wp cache flush

Hopefully that’ll solve your problem.
Let me know how you get on :smile:

Cheers,

Phill

2 Likes