Step 1:
Open httpd.conf file present in C:\xampp\apache\conf\httpd.conf
Remove the #(hash) sign present to include the “httpd-vhosts.conf” file in httpd.conf file.
Remove the #(hash) sign present to include the “httpd-vhosts.conf” file in httpd.conf file.
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
To
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Step 2:
Open httpd-vhosts.conf file present in xammp/apache/conf/extra/httpd-vhosts.conf
Create a virtualhost file. Open “httpd-vhosts.conf” file. And copy the below lines of code.
<VirtualHost *:80>
ServerName www.wpdev.go
ServerAlias wpdev.go
DocumentRoot E:\Web\Xammp\htdocs\wpdev
</VirtualHost>
DocumentRooT it's your project file path , Save the file.
Step3:
Open
C:\Windows\System32\drivers\etc\hosts
Add the below line at the end of the file.
127.0.0.1 wpdev.go
Restart apache server and visit the site URL.
That’s all is needed to set up a virtual host.
Replace wpdev.go with your preferable domain name, here wpdev.go is a domain name
##note: it's very important that after all this please stop your xammp apache and mysql then start it again.
No comments:
Post a Comment