📚 Tutorials · 2 min read

How to setup virtual host on XAMPP for Magento 2 local development

Magento 2 On Localhost , In this tutorials i am going to show you how to setup virtual hosts for Magento 2 websites with XAMPP running on windows There are 3 steps to setup Magento...

Magento 2 On Localhost , In this tutorials i am going to show you how to setup virtual hosts for Magento 2 websites with XAMPP running on windows

There are 3 steps to setup Magento 2 on localhost you have to follow

1.) Add vitual host configuration in D:\xampp\apache\conf\extra\httpd-vhosts file . location of file depends on where you have installed xampp .

open httpd-vhosts file , add below code and replace yourdomainname and project directory with yours.finally save the file.


      ServerAdmin youremail@yourdomainname.com
      DocumentRoot "D:/xampp/htdocs/Projectname/pub"
      ServerName yourdomainname.com
      ServerAlias www.yourdomainname.com
    ##ErrorLog "logs/dummy-host.example.com-error.log"
    ##CustomLog "logs/dummy-host.example.com-access.log" common

2.) In this step you have to add the yourdomain name in hosts file located at C:\Windows\System32\drivers\etc\hosts .
open file in editor with Administrative Privileges , add below line and save it.

127.0.0.1  yourdomainname.com

3.) Please restart apache using XAMPP control panel and update the base url in core_config_data table to your new setup vitualhost.

For More Information Contact To Magento Services

Tagged: Tutorials Magento 2
Share: Twitter LinkedIn
Tutorials
How to add Slick slider in Magento 2 Custom theme
2 min read →
Tutorials
How to Create Controller in Magento 2
2 min read →
Tutorials
How to Set up multiple websites, stores, and store views in the Admin ...
2 min read →

Need Expert Magento Help?

Our certified Magento 2 & Hyvä team is ready for your project.

Get Free Quote 📞 Call Us