Thread: PHP doc_root View Single Post
 03-29-2011, 07:10 PM #6 (permalink) tony The Addict     Join Date: Aug 2008 Posts: 336 Thanks: 8 It can't be done with just the .htaccess file. It's been a while since I've use windows and apache, here is what I would have done: 1.) The host file needs to be changed. In WinXP is the folder C:\WINDOWS\system32\drivers\etc\. You should be seen this already Code: `127.0.0.1 localhost` now just add another line, so it will end up like this Code: ```127.0.0.1 localhost 127.0.0.1 holidaywebsite.local``` (Note: I usually put .local on my local domains, but you don't need to) 2.) Now about the virtual hosts or vhosts. That depends what method you used to install your Apache server like using WAMP or XAMPP or just normal installation. I don't know, but I will assume you install it using the apache .exe file. The config file for vhosts is in C:\Program Files\Apache Group\Apache2\conf\vhosts.conf then add this: Code: ``` DocumentRoot C:/xampplite/htdocs/holidaywebsite/ ServerName holidaywebsite.local ``` The value of DocumentRoot is the folder where your website resides. Don't forget the trailing slash. If that file doesn't exists, create it. Then add this line to the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Code: `Include conf/vhosts.conf` 3.) Do a quick configuration check. Open C:\Program Files\Apache Group\Apache2\conf\httpd.conf your file and make sure that the following part is not commented out by a preceeding # character: Code: `Include conf/vhosts.conf` 4.) Restart Apache. That is a rough estimate of what needs to be done for a virtualhost.