小编Dor*_*ice的帖子

301 htaccess中的重定向将旧文件名附加到新网址

我在我的htaccess文件中使用301重定向规则将一些旧网址重定向到新网址.但是,在一些重定向上,旧的文件名将附加到新的URL上,因此我在这些页面上出现404页面错误.

例如,这是我的重写规则

Redirect 301 /mtrx/motion-control/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Run Code Online (Sandbox Code Playgroud)

但显示的页面是

http://www.zerolinegolf.com/golf-mtrx-for-the-golfermotion-control
Run Code Online (Sandbox Code Playgroud)

这是整个.htaccess代码

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

#REDIRECTS

Redirect 301 /videos/ http://www.zerolinegolf.com/videos-2
Redirect 301 /press-releases-2/ http://www.zerolinegolf.com/media
Redirect 301 /mtrx/motion-control/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Redirect 301 /mtrx/pelvis-power/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Redirect 301 /mtrx/mtrx-score/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Redirect 301 /mtrx/recommended-drills/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Redirect 301 /mtrx/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

apache .htaccess http-redirect

2
推荐指数
1
解决办法
5131
查看次数

标签 统计

.htaccess ×1

apache ×1

http-redirect ×1