Support the ongoing development of Laravel.io →
Requests Testing

Hi all,

I am a beginner in laravel,

I am following the following course to learn routing in laravel:

https://openclassrooms.com/courses/decouvrez-le-framework-php-laravel/le-routage-2

the root page of laravel website is accessible perfectly,

But, other fictive pages corresponding to the routes defined in routes.php are not accessible: Route::get('1', function() { return 'Je suis la page 1 !'; });

In fact, I receive the following error message when I visit the URL (laravel.example.com/1) knowing that laravel.example.com is pointing to localhost (127.0.0.1) in hosts file:

Not Found The requested URL /1 was not found on this server. Apache/2.4.16 (Ubuntu) Server at laravel.example.com Port 80

The access log of apache contains the following:

127.0.0.1 - - [12/Jan/2016:20:21:33 +0100] "GET /1 HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36"

Could you please assist me in testing routing under laravel!!

Last updated 3 years ago.
0

This sounds like an apache related problem (since you seem to have defined your route correctly).

My first to checks here would be:

  1. Is mod_rewrite enabled? Without this your .htaccess won't be used.

  2. Are you allowing rewrites within your virtual host declarations and in your config? (Sorry you didn't mention how well you know apache).

  3. Are your laravel folder permissions correctly set? (See https://laravel.com/docs/5.2/installation in the section on directory permissions). [I circumvented this problem by changing my apache user to match my user - but probably wouldn't do this in production].

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.