我在我的 htaccess 文件中使用 301 重定向规则将一些旧网址重定向到新网址。但是,在一些重定向中,旧文件名附加到新 url 上,因此我在这些重定向上遇到 404 页面错误。
例如,这是我的重写规则
Redirect 301 /mtrx/motion-control/ http://www.zerolinegolf.com/golf-mtrx-for-the-golfer
但显示的页面是
http://www.zerolinegolf.com/golf-mtrx-for-the-golfermotion-control
这是整个 .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
感谢您的帮助。