How to setup virtual url for Magento in XAMPP

To set up a virtual URL for Magento in XAMPP, you can follow these steps:

  1. Open the XAMPP Control Panel and start Apache and MySQL.
  2. Navigate to the httpd-vhosts.conf file located in the xampp\apache\conf\extra directory.
  3. Uncomment the line #Include conf/extra/httpd-vhosts.conf by removing the # at the beginning of the line.
  4. Add the following code to the httpd-vhosts.conf file:
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/magento"
    ServerName magento.local
    ErrorLog "logs/magento-error.log"
    CustomLog "logs/magento-access.log" common
</VirtualHost>
  1. Save the file and restart Apache.
  2. Open the hosts file located in C:\Windows\System32\drivers\etc.
  3. Add the following line to the end of the file:
127.0.0.1 magento.local
  1. Save the file.
  2. Open your web browser and go to http://magento.local. Magento should now be accessible through the virtual URL.

Note: Replace C:/xampp/htdocs/magento with the actual path to your Magento installation directory.


Posted

in

by