0

OK I have been battling this for a week,

I have Xampp running on my home server and I am trying to get subdomains to work, I edited my windows host file so that all of these load my site,

http://localhost/ http://mydomain.com/

http://images.mydomain.com/ http://images.localhost/

I then modified my Apache conf file to add my virtual host to make the images.mydomain.com and images.localhost to load up my localhost/images folder but for some reason they load the contents of http://localhost/ as if I am going to the regular site and not a subdomain, any idea why?

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /htdocs/images/
    ServerName images.localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /htdocs/images/
    ServerName images.mydomain.com/
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /htdocs/
    ServerName mydomain.com/
</VirtualHost>
2
  • You didn't include the 'http://' in your hosts file, did you?
    – innaM
    Jul 30, 2009 at 9:09
  • no serrverfault filters changed those into links on me
    – JasonDavis
    Jul 30, 2009 at 10:09

5 Answers 5

1

Try to delete the trailing slash on the ServerName lines.

1
  • yeah I did that but no luck either
    – JasonDavis
    Jul 30, 2009 at 10:11
0

Or give the full path to the folder:

DocumentRoot c:/htdocs/mydomain ServerName mydomain.com/

1
  • yes I added full path and restart apache but no luck
    – JasonDavis
    Jul 30, 2009 at 10:10
0

What happened if you ping to images.mydomain.com? Do you obtain a response from your server?

0

I think you forgot to add " to DocumentRoot. You should try something like this DocumentRoot "/htdocs/images/"

0

Did you fill your /etc/hosts with the entry images.localhost ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .