Patrick Posted February 25, 2003 Share Posted February 25, 2003 Hi there, I have a question, and I\'m not sure if it possible... I am running Apache, and using localhost for as my test server. It is not serving any pages outside of a localhost environment. The document root is set to htdocs, and each of the sites that I work on sits in a folder in htdocs. I am programming in Dreamweaver MX, and I need to use Site Root relative links. If I set the document root in Apache\'s config file to htdocs/sitex then http://localhost will give me sitex as expected. But I can\'t access any other site. Without setting the document root to htdocs/sitex, the root relative links in the site all point to the root - htdocs, not where I want them - htdocs/sitex. I investigated virtual hosts, and it seems that this is only any good for requests being served from outside, and not locally. What I want to achieve is instead of setting the document root to htdocs/sitex and then typing http://localhost to access sitex, I want to be able to type http://sitex (or something) and get sitex and http://sitey for sitey. This will allow site root relative links on all my sites to work as and when required, without changing the apache config settings. My question then I guess is: is it possible to use virtual hosts locally? I hope I have explained my situation clearly enough for someone to know what I\'m talking about and even possibly come back with an answer to my problem. Any assistance is greatly appreciated. Regards, Patrick Quote Link to comment https://forums.phpfreaks.com/topic/181-virtual-hosts-and-localhost/ Share on other sites More sharing options...
effigy Posted February 27, 2003 Share Posted February 27, 2003 you can look into the name based hosting and using \'sitex\' for example: http://httpd.apache.org/docs-2.0/vhosts/na...name-based.html i\'m not sure how well this will work - the user may have to have the name in their hosts file if there is no dns server present. :shock: Quote Link to comment https://forums.phpfreaks.com/topic/181-virtual-hosts-and-localhost/#findComment-532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.