I tried to set virtual host for Magento2(2.2.5) Project in Ubuntu system under Lampp service.
I added this piece of code under opt/lampp/etc/extra/httpd-vhosts.conf
<VirtualHost *.:80> ServerName magento2.local DocumentRoot "/opt/lampp/htdocs/Magento2/" DirectoryIndex index.php <Directory "/opt/lampp/htdocs/Magento2/"> Options All AllowOverride All Require all granted </Directory> </VirtualHost>
And added that under /etc/hosts
Uncommented below piece of line under nano /opt/lampp/etc/httpd.conf
Restarted the service
After this when I try to hit magento2.local it again redirects with the normal URL localhost/Magento2
Welcome for suggestions.
Thanks in advance.