Prevent wordpress from redirecting to your live website

Have you gotten yourself into a situation that goes something like this? You installed your wordpress on your web hosting. Then you realise that you need a copy on your local computer.

So logically you would install wamp, download the whole wordpress folder in your machine,  import back the database to mysql. Change the wpconfig.php, then you’re done. Right?