Add www to URL
Posted by: iamj_kim (192.159.167.---)
Date: July 20, 2014 04:07AM

Hi,
I have successfully created vhost thanks to this forum. I'd like to also access the site with www. prefix. So for example, both "mysite" and "www.mysite" will both access the same site in the vhost folder. How can I accomplish this?

Thanks.

Options: ReplyQuote
Re: Add www to URL
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 22, 2014 10:59AM

First add the domain to your HOSTS file so that windows knows where to find the new domain just like when you told it about the original mysite.dev like so:-

127.0.0.1 mysite.dev  www.mysite.dev
::1 mysite.dev  www.mysite.dev

Then amend the VHOST definition so Apache also knows about the new domain by adding a server alias like so :-

    ServerName = mysite.dev
    ServerAlias = www.mysite.dev

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.