Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When developing WordPress websites, for instance, such a script saves a few values on the database with detected paths/addresses. To avoid issues when uploading the production version to the server (when the project is finished or updated) I normally setup my web development environment like this:

hosts file:

Apache virtual hosts file:

<VirtualHost *:80>
    DocumentRoot "C:\Users\Nazgulled\Workspace\World Wide Web\Htdocs\"

And I'm done. I can access or like I was accessing the real server but I'm actually accessing my local development server.

However, I was wondering if I could this some other way... I mean, keep both and accessing the real server and something like http://domain acessing my local server. But in a way so that the WordPress script (or any other) detect the address as or and not simply as domain.

Any possible way to configure Apache virtual hosts for this kind of behavior? Besides that, do you have any other suggestions for a better virtual hosts configuration for local development simulating the real server location?

share|improve this question
up vote 0 down vote accepted

if you use firefox there is quite a cool way:


there you can manage and switch between multiple host files.

for example: you create one production host file and one development host file. the production host file is empty so every domain is resolved by its real ip. the development host file has all your local lookup information inside.

Server Switcher

maybe also worth a try.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.