# Local Redirecting to Live Site

**URL:** <https://community.localwp.com/t/local-redirecting-to-live-site/3938>\
**Category:** Support\
**Created:** [November 21, 2017, 9:40pm UTC](https://community.localwp.com/t/local-redirecting-to-live-site/3938 "2017-11-21T21:40:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Phiph](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Phiph](https://community.localwp.com/u/Phiph)\
**Post date:** [November 23, 2017, 3:51pm UTC](https://community.localwp.com/t/local-redirecting-to-live-site/3938/2 "2017-11-23T15:51:28Z")

</div>

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 😄

Cheers,

Phill

---

_[View the full topic](https://community.localwp.com/t/local-redirecting-to-live-site/3938)._
