is it possible to create subdomains on my localhost? like
and would like to know how subdomains work.
Create a virtual host as such:
<VirtualHost *:80> ServerName sub.localhost DocumentRoot "C:/public_html/sub" </VirtualHost>
And in your hosts file add this line:
Here is a useful tutorial you might find helpful.
You can make your browser to point to any domain/subdomain that you want as long as you put the ip – hostname definition in your
c:\Windows\System32\drivers\etc\hosts file, for example:
or on the same line separate by space:
127.0.0.1 sub.localhost subsub.localhost local.host
Add the following to your local hosts file. On windows, it’s located at
127.0.0.1 with whatever IP address you want.