Otomatic Wrote:
-------------------------------------------------------
> Hi,
>
> If the ServerName is johny.com the url of the site
> is 'http://johny.com/'
>
> If you want it can be also opened as
> 'http://www.johny.com/' you need to add a
> ServerAlias directive in the VirtualHost
> ServerAlias www.johny.com
>
> Remember that in order for VirtualHost changes to
> take effect, you must restart Apache
> - Left-Clcik Wampmanager tray icon -> Apache ->
> Service administration -> Restart service
>
> Remember that for changes to the hosts file to
> take effect, you must restart the DNS.
> - Right-Click -> Tools -> Restart DNS
Thanks again for the reply!
So in C:\wamp\bin\apache\apache2.4.27\conf\extra\httpd-vhosts.conf I added as suggested just below ServerName
<VirtualHost *:80>
ServerName johny.com
ServerAlias www.johny.com
but it would not open simple image file ie. [
www.johny.com]
I made sure and restarted DNS, Apache and all other services.
It worked only after I added 127.0.0.1 www.johny.com
to hosts file: C:\Windows\System32\drivers\etc\hosts
My question is, did I do it right by modifying hosts file?
Edited 1 time(s). Last edit at 10/12/2017 12:07AM by JohnyBeGood.