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:
127.0.0.1 www.domain.com 127.0.0.1 domain.com
Apache virtual hosts file:
<VirtualHost *:80> DocumentRoot "C:\Users\Nazgulled\Workspace\World Wide Web\Htdocs\domain.com" ServerAlias www.domain.com ServerName domain.com </VirtualHost>
And I'm done. I can access
www.domain.com 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
www.domain.com 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
www.domain.com and not simply as
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?