To set up a virtual URL for Magento in XAMPP, you can follow these steps:
- Open the XAMPP Control Panel and start Apache and MySQL.
- Navigate to the
httpd-vhosts.conf
file located in thexampp\apache\conf\extra
directory. - Uncomment the line
#Include conf/extra/httpd-vhosts.conf
by removing the#
at the beginning of the line. - 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>
- Save the file and restart Apache.
- Open the
hosts
file located inC:\Windows\System32\drivers\etc
. - Add the following line to the end of the file:
127.0.0.1 magento.local
- Save the file.
- 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.