How do I get a subdomain on Xampp Apache @ localhost?
- by jasondavis
**UPDATE-
I got it working now, I just had to change
to
The port number is important here.
I just modified my windows HOST file
@ C:\Windows\System32\drivers\etc
and added this to the end of it
127.0.0.1 images.localhost
127.0.0.1 w-w-w.friendproject-.com
127.0.0.1 friendproject.-com
Then I modified my httpd-vhosts.conf file on Apache under Xampp
@ C:\webserver\apache\conf\extra
Under the part where it shows examples for adding virtualhost I added this code below:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /htdocs/images/
ServerName images.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /htdocs/
ServerName friendproject.com/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /htdocs/
ServerName w-ww-.friendproject.c-om/
</VirtualHost>
Now the problem is when I go to any of the newly added domains in the browser I get this error below and even worse news is I now get this error even when going to http://localhost/ which worked fine before doing this
I realize I can change everything back but I really need to at least get
htt-p://im-ages.localhost to work.
What do I do?
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster
.
Error 403
localhost
07/25/09 21:20:14
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9