Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 拉威尔301重定向_Laravel_.htaccess_Redirect_Laravel 5 - Fatal编程技术网

Laravel 拉威尔301重定向

Laravel 拉威尔301重定向,laravel,.htaccess,redirect,laravel-5,Laravel,.htaccess,Redirect,Laravel 5,如何获得301重定向以使用public.htaccess文件?因为后面的反斜杠,它似乎不起作用 .hataccess <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder.

如何获得301重定向以使用public.htaccess文件?因为后面的反斜杠,它似乎不起作用

.hataccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    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]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    Redirect 301 /old-page/ http://www.mysite1.com
    Redirect 301 /old-page-1/ http://www.mysite1.com/join-the-team
    Redirect 301 /old-page-3/ http://www.mysite1.com/join-the-team
    Redirect 301 /old-page-4/ http://www.mysite1.com
    Redirect 301 /old-page/old-page/ http://www.mysite1.com/join-the-team

</IfModule>

那很好。问题是我需要那些尾随的斜杠,因为谷歌有这样的老链接

在重写之前尝试移动重定向。@JoséA.Zapata我曾尝试将它们放在
之外的最顶端,但nadaFor目前只是将重定向移动到
routes.php
中,比如:`Route::get('/old page/',function(){return redirect('/');})`在重写之前尝试移动重定向。@JoséA.Zapata我曾尝试将它们放在
之外的最顶端,但nadaFor目前只是将重定向移动到
routes.php
中,比如:`Route::get('/old page/',function(){return redirect('/');})`
Redirect 301 /old-page/no-slash http://www.mysite1.com