Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I thought I was doing it right but obviously ... not

in C:\Windows\System32\drivers\etc\host

127.0.0.1       myDomain

Question 1 : why doest it work for 'myDomain' (myDomain leads to localhost) but not 'myDomain.com' ? Everytime I add dots to the name, it is not recognized (http://myDomain.com is an error)

in Apache conf :

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/myproject/web"
    ServerName myDomain
ServerAlias myDomain
    <Directory "C:/wamp/www/myproject/web">
    AllowOverride All
    Allow from All
</Directory>
</VirtualHost>

if I type in a browser : http//myDomain => I am in the documentRoot but I cannot access directly to what is in the web folder :

Obviously there is something I did not understand, I thought that using the virtual host name (myDomain) I would be in the web folder.

Question 2 : what is wrong ?

Thank you for your help

share|improve this question

migrated from stackoverflow.com Apr 8 '13 at 23:47

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 0 down vote accepted

Because myDomain.com is a different Domain than myDomain. Using myDomain.com in the hosts-file and your Apache config should do the trick.

By the way: One of ServerName or ServerAlias should be enough (i.e. leave your ServerName as it is and edit ServerAlias to say myDomain.com

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.