Support the ongoing development of Laravel.io →
posted 7 years ago
Last updated 2 years ago.
0

If I remember correctly, Laravel automatically removes the trailing slash from URLs unless it's a folder. Here's what's in the .htaccess file in the /public/ folder:

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

Try replacing it with something like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)([^/])$ /$1$2/ [L,R=301]
0

Sign in to participate in this thread!

Eventy

Your banner here too?

monovm monovm monovm Joined 3 Jul 2017

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.

© 2024 Laravel.io - All rights reserved.