phplaravelhostsvirtual-hosts

Laravel 5 on Virtual machine on Windows


I'm setting up an existing Laravel app onto a Windows machine for testing. The windows machine has a virtual machine setup and is running Linux.

I've edited the Windows hosts file to include the IP address and if I go to http://app.dev I can see the Laravel app as expected. however, as soon as I try to go to http://app.dev/page I get a 404 error.

The routing is set up correctly and this works fine on my typical dev machine, which is a Mac. Is there an additional setting I need to apply to make paths beyond the root path for the domain work?


Solution

  • If using Apache, make sure you have mod_rewrite enabled and either AllowOveride on (to use the htaccess file) or make the entries in the Apache Virtualhost to handle the rewrites.