Some time we need to create subdomain on our localhost or local server. I have also faced this problem so that I am going to share with you that how to create subdomain on localhost. Creating subdomain on your local server is very easy.
Creating subdomain on XAMP or Local Server
If you want to create subdomain on xamp then follow the following instruction.
- Find the following file on your system
- Add the following code at the end of the file
# Custom Server and hosts
- Now find the following file and open that
- Add the following code at the end of this file
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
- Now restart your server. You can access your subdomain like http://subdomain.localhost.com