I am starting to learn how to work with laravel but got a problem. When I go to: http://localhost/testing/public/ I get a working page but when I typ for example http://localhost/testing/public/home which is one of my views I get a 404 error. Does someone know how to fix this?
Edit: I am using the latest version of laravel and when I do for example:
Route::view('/home', 'home');
In my routes/web.php I get that error
This is more likely a problem with virtual Hosts, try the following:
Route::get('/home', function(){echo
"hello"});http://localhost/testing/public/index.php/homeIf it works then its certainly because you don't have a virtualHost, you can set it easily in your Xampp config and modifying ur hosts file
C:\Windows\System32\drivers\etc\hosts and add a new
line like: 127.0.0.1 yoursite.localxampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>DocumentRoot "PATH_to_laravel_folder/public" ServerName yoursite.local
</VirtualHost>
yoursite.local/home or
yoursite.local:80/homeHope it helps you guys :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With