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 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 email@example.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.
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 BlogsSee all posts
- How to setup virtual host on XAMPP for Magento 2 local development March 13, 2023
- What’s New In Magento 2.4.6 ? Features, Enhancements . March 9, 2023
- How to Create Controller in Magento 2 March 5, 2023