Assuming that your DNS is set up correctly for laptop.local, you will likely only need to update your WAMP configuration to make use of the appropriate Apache virtual host(s).
Configuring WAMP
Create a directory to house your sub-domain(s). Make sure this is done in a location which your WAMP installation can access (e.g. under or alongside your root www
folder).
Open Apache httpd.conf (located in your WAMP installation under the Apache conf
directory or through the appropriate menu interface e.g. Apache → httpd.conf
).
Uncomment this line (remove the #):
# Include conf/extra/httpd-vhosts.conf
which should then become
Include conf/extra/httpd-vhosts.conf
Open your Apache conf\extra
folder and find httpd-vhosts.conf
. Add something similar to the following at the end of the file:
# Virtual host entry for website.laptop.local
# Anything with a # is a comment
<VirtualHost *:80>
ServerName website.laptop.local
#ServerAlias *.website.laptop.local
# DocumentRoot should correspond to wherever the HTML files
# for your website.laptop.local site are located. This is an example!
DocumentRoot "C:/wamp/www/subdomains/my-website"
ErrorLog "logs/my-website-error.log"
CustomLog "logs/my-website-access.log" common
# If you have any problems with "Forbidden", try uncommenting
# the following (assumes Apache 2.4.x).
#<Directory "C:/wamp/www/subdomains/my-website">
#AllowOverride None
#Options None
#Require all granted
#</Directory>
</VirtualHost>
Make sure to enable your alias_module and vhost_alias_module Apache modules. Usually this is done (again) through the appropriate menu interface e.g. Apache → Apache modules
but can also potentially be done under httpd.conf
by simply uncommenting the appropriate module lines.
Restart your WAMP server.
Assuming there are no errors, website.laptop.local should now be available.
You're welcome. Glad to help. =) – Anaksunaman – 2017-10-05T06:41:33.463