论坛个人资料链接的 htaccess 301 重定向规则
我切换了论坛平台,并且想使用 301 重定向将请求重定向到会员个人资料。
用户配置文件的旧平台路径是:www.example.com/forum/member.php?u=XXXXXX 用户配置文件的新平台路径为: www.example.com/user/XXXXXX
切换期间用户 ID 保持不变。
我尝试通过编写以下 RewriteRule 来实现此目的:
RewriteRule ^forum/member.php?u=(.*)$ http://www.example.com/user/$1 [R=301,L]
不幸的是,由于某种原因它不起作用,我不明白为什么。任何帮助将不胜感激!
谢谢, -克里斯
I switched forum platforms and I'd like to redirect requests to member profiles using a 301 redirect.
The old platform path to user profiles was: www.example.com/forum/member.php?u=XXXXXX
The new platform path to user profiles is: www.example.com/user/XXXXXX
The user IDs have remained the same during the switch.
I tried to accomplish this by writing the following RewriteRule:
RewriteRule ^forum/member.php?u=(.*)$ http://www.example.com/user/$1 [R=301,L]
Unfortunately, it's not working for some reason and I can't figure out why. Any help would be greatly appreciated!
Thanks,
-Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法从 RewriteRule 指令访问查询字符串。
请尝试以下方法。
You cannot access the query string from a RewriteRule directive.
Try the following instead.