带有尾部斜杠的 URL 被重定向到 laravel 5 中的本地主机


URL with trailing slashes gets redirected to localhost in laravel 5

重复问题中的修复不起作用。

我尝试了堆栈溢出中的所有修复程序,但似乎没有任何效果拉拉维尔尾随斜杠重定向到本地主机

路线

Route::get('/admin', array('as' => 'admin', 'uses' => 'Admin'Admin@getLogin'));

此网址工作正常http://localhost/app/admin

但是当我在它前面添加一个尾部斜杠时 http://localhost/app/admin/它被重定向到 http://localhost/admin

帮助!

添加了这个,它奏效了!

RewriteCond %{REQUEST_URI} !^

我也遇到了这个问题,我需要将上述内容与其他一些帖子的建议相结合。不记得来自哪些帖子无论如何,这是我的.htaccess,让我正常工作。
还有一件事,我们的项目在网址中没有公开。

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On
    RewriteBase /PROJECT_NAME
    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_URI} !^
    RewriteRule ^(.*)/$ $1 [L,R=301]
    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>