I install wordpress on localhost.


WordPress stores site url and home url in database. And it can have only one value.

The easiest way to do it, would be to change these options to localhost address. If you do so, you will be able to work on this WordPress on localhost, but remote installation won't work (it will redirect you to localhost).

Another way to do this, is to fake DNSs response and set this domain to point on your localhost. You can do this by editing etc/hosts file, and then setting virtual host on your apache server.

I prefer second solution. WordPress will still work on remote server, and by editing etc/hosts file I can quickly change which WordPress will I see.

  • yeah I know wordpress save store url when process installation but we want to access remote dbase. I try to set block url of actual website but it will display localhost environment ( use XAMPP ). maybe there's someone can cheat on this system. It very useful for teamwork environment so data who received another developer it's same like each other who work / modify it together, it's sounds awesome. Jul 4 '13 at 8:31
  • @JokoWandiro: Did you read rest of my answer? I give you 2 solutions... Each one of them will do exactly what you want. Jul 4 '13 at 8:55
  • your first solution is change options url to localhost on database hosting or database localhost. I assume it to change on database hosting, right ? If I do it when I use Panel Administration on localhost could it insert / update new data to database hosting. Jul 4 '13 at 9:19
  • OK, let's make it clear. In both cases you have only one, remote database (on your remote server) and you connect all WordPresses to it. Since you have only one DB, then all changes are stored in it... The only thing you have to do is to make siteurl work both remotely and locally. You can either set "localhost" as this remote WP instalation or fake remote domain to point to localhost with etc/hosts file. Both solutions have nothing to do with remote DB. Jul 4 '13 at 9:31
  • I use your second solution. I set vhost and block request to actual website and set wp-config to access remote database and it's work thanks. Jul 4 '13 at 12:19

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.