Laravel 拉威尔301重定向
如何获得301重定向以使用public.htaccess文件?因为后面的反斜杠,它似乎不起作用 .hataccessLaravel 拉威尔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.
<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