configuring virtual host redirects to iis homepage

I have XAMPP running on Windows 10. I am trying to setup a Virtual Host so that when I use "myapp.dev" as a domain I get directly to my public folder of laravel project.
Laravel is located at C:/xampp/htdocs/myapp/public.
By using http://localhost:8000/myapp/public/ i can access laravel index.php
So far i have tried the following:
http v-host.conf file
#this is the default address of XAMPP    
<VirtualHost *:8000>
   DocumentRoot "C:/XAMPP/htdocs/"
   ServerName localhost
</VirtualHost>


<VirtualHost *:8000>
    DocumentRoot "C:/xampp/htdocs/myapp/public"
    ServerName myapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>

and in C:\Windows\System32\drivers\etc\host file

127.0.0.1 localhost
127.0.0.1:8000 myapp.test

and after restarting apache and typing myapp.test leads to iis homepage instead of index.php in public folder.
arsalan jibranAsked:
Who is Participating?
 
Martin MillerCTOCommented:
First, I am not sure you can add a port number to the host file and have this work.

You can do this...
127.0.0.1 myapp.test
127.0.0.1  myotherapp.test
127.0.0.1  yetanotherapp.test

Your vhost file, needs to be edited to something like this...


<VirtualHost myapp.test:8000>
    DocumentRoot "C:/xampp/htdocs/myapp/public"
    ServerName myapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>
<VirtualHost myotherapp.test:8000>
    DocumentRoot "C:/xampp/htdocs/myotherapp/public"
    ServerName myotherapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>

I think IIS is picking up on port 80, and that should be another clue for you.
0
 
Martin MillerCTOCommented:
Can I close this question ?
0
 
arsalan jibranAuthor Commented:
yes you can close this question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.