简体   繁体   English

当URL在wordpress上包含括号时,htaccess重定向

[英]htaccess redirect when URL contain Brackets on wordpress

I need to convert old hosting site URL where they contain (pid) eg /reviews/(pid)/* where * is a 5 digit unknown number eg 88326 to /reviews/ 我需要将旧托管站点URL包含(pid)的位置转换为例如/ reviews /(pid)/ *,其中*是5位未知数,例如88326转换为/ reviews /

I tried 我试过了

RewriteRule ^(.*)\/reviews\/\\(pid\\)\/(.*)$ \/reviews\/ [R=301,L]

It is a wordpress site so not sure if that is a reason its not working. 这是一个wordpress网站,因此不确定是否是其无法正常工作的原因。

When mass changing URLs in WordPress, I often use this handy plugin. 当在WordPress中大量更改URL时,我经常使用这个方便的插件。

Velvet Blues Update URLs 天鹅绒布鲁斯更新URL

FEATURES: 特征:

Users can choose to update links embedded in content, excerpts, or custom fields 用户可以选择更新嵌入在内容,摘录或自定义字段中的链接

Users can choose whether to update links for attachments 用户可以选择是否更新附件的链接

View how many items were updated 查看更新了多少项目

USAGE: 用法:

Using this plugin is very simple. 使用此插件非常简单。 Once it has been activated, navigate to Tools -> Update URLs and follow the instructions. 激活后,导航至工具->更新URL,然后按照说明进行操作。 Please Note: Changes are irreversible. 请注意:更改是不可逆的。 If you haven't used this plugin before, please backup your website before proceeding. 如果您以前从未使用过此插件,请先备份您的网站,然后再继续。


Example Screenshot: 屏幕截图示例:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM