0

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

mlwacosmos
  • 101
  • 1

1 Answers1

0

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