E
E
elailasou2015-09-11 15:26:14
Laravel
elailasou, 2015-09-11 15:26:14

How to remove the last slash on the main page in Laravel 5?

Can't remove last slash:
localhost.loomboom_laravel/
Routes:

Route::get('/', function () {
    return view('index');
});
Route::get('categories', function () {
    return view('categories');
});

.htaccess to /public:
RewriteEngine On

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

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

If you go to localhost.loomboom_laravel/categories/, then the last slash is removed according to the rules of .htaccess

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-09-11
@Stalker_RED

Here people specifically add it blog.agel-nash.ru/2013/6/laravel4-and-stupid-seour...
But you can take this instruction and do the opposite.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question