0

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?

TH1981
  • 3,105
  • 7
  • 42
  • 78
  • It's on a virtual Linux machine on the Windows machine. The virtual machine is setup through VMware. I've manually added the virtual host on the Linux machine and updated the hosts file on the Windows machine. – TH1981 Jan 10 '18 at 21:56
  • I mean, what web server is running on the VM? Apache? artisan serve? – Devon Bessemer Jan 10 '18 at 22:00
  • sorry! It's running Apache. – TH1981 Jan 10 '18 at 22:03
  • Sounds like you don't have AllowOverride enabled so it isn't able to use the .htaccess fil – Devon Bessemer Jan 10 '18 at 23:57
  • https://laravel.com/docs/5.0/configuration#pretty-urls – sumit Jan 11 '18 at 02:20
  • @Devon - that was it. I ran through the process here: https://stackoverflow.com/questions/18740419/how-to-set-allowoverride-all#22526144 including running `sudo a2enmod rewrite` before it was all working. Add an answer and I'll give you the credit. – TH1981 Jan 14 '18 at 17:08

1 Answers1

1

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.

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95