0

由于 url 中缺少特殊字符“&”,我收到 404 错误。因此我想从

http://www.example.com/option=com_rplview=propertyshowpid=5127

http://www.example.com/option=com_rpl&view=propertyshow&pid=5127

我该如何使用 .htaccess

谢谢,R

4

2 回答 2

0

看起来你错过了?来自除 & 之外的查询字符串。假设您只想匹配这个确切的 URL (pid=5127) -

RewriteEngine On
RewriteBase /
RewriteRule (option=com_rpl)(view=propertyshow)(pid=5127) /?$1&$2&$3 [R=301,L]

如果您想匹配任何pid1 到 4 位数长的值

RewriteEngine On
RewriteBase /
RewriteRule (option=com_rpl)(view=propertyshow)(pid=\d{1,4}) /?$1&$2&$3 [R=301,L]
于 2012-10-21T03:40:12.263 回答
0

Url 将 amersand (&) 编码为%26正确的方法。replace & by %26

于 2012-10-21T03:41:02.223 回答