Reputation: 4161
I prefer to put my projects in the localhost as http://domain.local
In addition, I use Git to push files to the remote server. The problem is that I don't want to edit the domain name on the server on each time the website is updated.
I don't think it is the right way to use http://domain.com
in the localhost. What is the right way to overcome this issue?
To note, there are subdomains such as images.domain.local
Upvotes: 2
Views: 107
Reputation: 16625
Most web frameworks store configuration for development setup and production server in separate files. Do not hardcode domain name and use such standard mechanism. You can choose between the configurations using git commit hooks, by reading machine hostname etc.
Upvotes: 2
Reputation: 7521
Upvotes: 1
Reputation: 522042
Don't hardcode the domain, use $_SERVER['HTTP_HOST']
or whatever the equivalent is in your language/environment of choice to let your application dynamically figure out what domain it's running on.
Upvotes: 3