Any difference between dev and prod is bad. Here is what I do:
- Have a different ip for dev server (Whether internal, external, or on local computer is unimportant) — but dev server must be the exact same setup (see bottom paragraph)
- Change the hosts file (see here) (on yours or a testing computer or a virtual machine) to point to dev server ip
- Result: HTTP requests sent to dev server have Host header field set as “example.com” exactly like it will be for the prod server.
This method removes two differences often encountered otherwise:
- having to change domain name
- having dev code in a subdirectory, but prod code in root or diff subdirectory. This is because I use git to transfer files between dev and prod.
.
.
The dev server is set up exactly the same as the prod server (see Chef or Puppet for how to programmatically manage servers).