Wednesday, August 23, 2017

How to set up your own custom domain on Localhost?

Step 1
Go to C:\wamp\bin\apache\Apache2.2.17\conf\
open httpd.conf file and change
#Include conf/extra/httpd-vhosts.conf
to
Include conf/extra/httpd-vhosts.conf
i.e. uncomment the line so that it can includes the virtual hosts file.

Step 2
Go to C:\wamp\bin\apache\Apache2.2.17\conf\extra
and open httpd-vhosts.conf file and add the following code

<VirtualHost myproject.com>
    DocumentRoot "C:/wamp/www/myproject/"
    ServerName myproject.com
    ServerAlias myproject.com
    <Directory "C:/wamp/www/myproject/">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

change myproject.com and C:/wamp/www/myproject/ as per your requirements.

Step 3
Open hosts file in C:/Windows/System32/drivers/etc/ and add the following line ( Don't delete anything )

127.0.0.1 myproject.com

change myproject.com as per your name requirements

Step 4
restart your server. That's it

No comments:

Post a Comment