lundi 18 mars 2019

Laravel routing works only with '/' and not with '/stuff'

I have just started trying to learn Laravel (5.8).

I am using XAMPP for local development, on Windows.

I have followed an online example that integrates Bootstrap 4 with Laravel, using the Album theme.

The project is called Album and it is outside of XAMPP; therefore I have set a VirtualHost:

<VirtualHost *:80>
   ServerName album.dev
   DocumentRoot Z:/WebDev/Projects/Album/public
   <Directory " Z:/WebDev/Projects/Album">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
   </Directory>
</VirtualHost> 

If I invoke album.dev on the browser it works fine, I get the expected home page.

However, when, as per the example instructions, I try to launch with: album.dev/demo, I get Error 404.

This is what my web.php looks like now:

Route::get('/', function () {
 // return view('welcome');
    return view('demo');
});

// does not work:
Route::get('demo', function () {
    return view('demo');
}); 

Evidently, I have not understood something quite fundamental about Laravel.

(Please feel free to modify the Title of this question, as needed)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire