Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 1 year ago.
0

I think if you do UsersController@getIndex instead it would work with a trailing slash.

Example:

Route::controller('/users', 'UsersController@getIndex');
Last updated 1 year ago.
0

Try changing this line in your .htaccess file to this:

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

Note the missing slash before $1.


If you don't want it to redirect at all, just remove that line entirely.

Last updated 1 year ago.
0

@Bubka3, that may work, but I would rather not have to create a route for each method of the controller if possible.

@JosephSilber, when I remove the slash before the $1 it gives me a 403 Forbidden.

What I did was remove the "L," to make it:

RewriteRule ^(.*)/$ $1 [R=301]

and it seems to be working the way I want now.

Thank you both for the help!!!

Last updated 1 year ago.
0

Pretty sure this is a configuration problem. Have you told laravel where the application's request root is? Also, if you're setting up an admin, you should be setting up an admin-test prefix for your routes as part of a group.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jhoylman jhoylman Joined 7 Apr 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.

© 2024 Laravel.io - All rights reserved.