laravel trailing Slashes redirect to localhost

When I try this

http://localhost/Testlaravel/public/users/login

it works. But when I try

http://localhost/Testlaravel/public/users/login/ 

it redirects me to

http://localhost/users/login/

Any idea why?

This 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>

Solution 1:

Change your code to this:

Options -MultiViews
RewriteEngine On
RewriteBase /Testlaravel/public/

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

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

Solution 2:

If the above method not working then clear your browser history with cache and try again.