cms php 旋律 url 重建需要重写规则

Rewrite rule needed for cms php melody urls rebuilding

我最近将我的网站 cms 从旧版本升级到新版本, 一切都很好,除了旧视频 url 是基于该格式构建的:

www.example.com/artist_name/videoUrl_ID.html

艺术家姓名字段已从数据库中删除以适应新的数据库架构。. 为了避免这个问题,我需要将这些网址重写为:

www.example.com/videoUrl_ID.html

这意味着从 url 中删除此 artist_name 字段(网络上发布的旧 url)

{$video_data.uniq_id}:我用来调用视频 ID 的代码。 解释:

http://www.example.com/CNN_News/news-march-30-2016_3a7017eff.html

必须改为:

http://www.example.com/news-march-30-2016_3a7017eff.html

您可以在站点根目录 .htaccess 中尝试此规则:

RedirectMatch 302 ^/[\w-]+/([\w-]+\.html)$ /