Support the ongoing development of Laravel.io →
Configuration Requests

Hello guys, I have a problem and I can't find a solution for it. I have googled and tried the solutions from there, but the problem stays. I also asked on stackoverflow - didn't help. (http://stackoverflow.com/questions/24600848/laravel-4-2-trailing-slash-leads-to-base-uri)

I use restful controllers. When I visit http://localhost/project/public/subsite it works. But when I visit http://localhost/project/public/subsite/ it redirects me to http://localhost/subsite.

This is my .htaccess file:

 <IfModule mod_rewrite.c>
 <IfModule mod_negotiation.c>
     Options -MultiViews
 </IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Last updated 3 years ago.
0

Did you even try my answer from StackOverflow?

Last updated 3 years ago.
0

Yes I did, but with the same result :/

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

norbertVC norbertvc Joined 5 Aug 2014

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.