0
votes

I am new to Laravel and while creating a new project, I wanted it to be named in Virtual Host. By this way,

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/logo/public"
    ServerName logo.local
</VirtualHost>

I named it, defined IP address for it (127.0.0.1) in HOSTS file but now, when I write localhost/ in the address bar, instead of going to Xampp("Welcome to XAMPP"), it goes to my laravel project. I know that if I will define my localhost the same way, like

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/"
    ServerName localhost
</VirtualHost>

the problem will be solved but I don't know the reason of doing this. Why do I need to name C:/xampp/htdocs/ as localhost, if it was default before my laravel project?

1

1 Answers

0
votes

if i get your meanings correct, you need add a default virtual host before other virtual host, so in your case, should be like this,

add the code block to end of the httpd.conf

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/logo/public"
    ServerName logo.local
</VirtualHost>

and edit hosts file to

127.0.0.1    localhost
127.0.0.1    logo.local