How to setup virtual host on XAMPP for Magento 2 local development
- February 16, 2023
- Uncategorized
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.
<VirtualHost *:80>
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
</VirtualHost>
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
About us and this blog
We are a digital magento 2Â development agency with a focus on helping our customers achieve great results across several key areas.
More from our blog
See all postsRecent Posts
- How to add Slick slider in Magento 2 Custom theme March 4, 2023
- How to Set up multiple websites, stores, and store views in the Admin Magento 2 February 27, 2023
- How to Create Controller in Magento 2 February 25, 2023