# Problem of redirecting the local site to online site

**URL:** <https://community.localwp.com/t/problem-of-redirecting-the-local-site-to-online-site/1283>\
**Category:** Support\
**Created:** [April 24, 2017, 2:25pm UTC](https://community.localwp.com/t/problem-of-redirecting-the-local-site-to-online-site/1283 "2017-04-24T14:25:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [April 25, 2017, 3:11pm UTC](https://community.localwp.com/t/problem-of-redirecting-the-local-site-to-online-site/1283/2 "2017-04-25T15:11:19Z")

</div>

Hi Guy,

I would recommend using WP-CLI to do a search-replace to fix the old domains. 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](http://olddomain.com) being your live domain and [newdomain.com](http://newdomain.com) being your Local site domain)
4. Done!

---

_[View the full topic](https://community.localwp.com/t/problem-of-redirecting-the-local-site-to-online-site/1283)._
