When we develop websites on the staging server (CentOS) on the LAN, we end up storing it in something like:
/var/www/html/project1.com
And to access it through a web browser on the LAN:
http://ourserver/project1.com
When it gets published on a public hosting service it is then:
http://project1.com
Is there a way to match the same domain structure on the staging server for the LAN as when it is published? So that during development when we type in http://project1.com in a web browser, it knows to go to http://ourserver/project1.com?
I've not been able to find documentation that describes doing this. What I've seen so far is geared towards domains that are publicly being hosted with a public registered DNS.
I have looked into /etc/hosts, but that doesn't allow something like this:
ourserver/project1.com project1.com
which what I would want to map project1.com requests on the LAN to point to http://ourserver/project1.com
You can't resolve a URL such as
ourserver/project1.com
with DNS or hosts, just the left hand side separated by the forward slash. All you can really do is configure a virtual host on your staging server to point at your project folder and use hosts or a local DNS server to resolve the domain.