htaccess 中的 Cakephp 客户重定向

Cakephp customer redirect in htaccess

我正在从旧的内容管理迁移到 cakephp。旧站点中的文章 link 编辑如下:

url/what-you-need-to-know-about-your-vehicles-axle-shafts-a655.html

新的link是这样的:

url/articles/what-you-need-to-know-about-your-vehicles-axle-shafts-a655.html

点击旧 links 时,我没有遇到任何 404 用户。

如何在用户每次点击旧版时将他们转发到新版link?

我尝试了一些 techniques outlined here 但没有成功

尝试将此添加到您的 htaccess 文件的顶部附近:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond  !^articles/
RewriteRule ^(.+\.html)$ /articles/ [L,R]