Support the ongoing development of Laravel.io →
Configuration Requests Installation

So I've got this: Route::get('thread','ThreadController@index'); Route::get('thread/{id?}','ThreadController@show');

And its all set up and working so that if its: http://localhost/projects/laravel-test/public/thread/5 I get the thread.

However if I do not enter a parameter in the query, it simply redirects to: http://localhost/thread

and not: http://localhost/projects/laravel-test/public/thread

Why is that?

Thanks

Last updated 2 years ago.
0

Fixed. For any future users it was a problem with the htacess file Laravel ships with within the public folder.

Just needed to add: RewriteBase /projects/laravel-test/public RewriteRule ^(.*)/$ $1 [L,R=301]

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Osiruss osiruss Joined 27 Oct 2015

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.