-1
我试图http://example.com/for-sale/?property=1234重定向到http://example.com/for-sale/property-name/在.htaccess中,使用的RewriteCond重写规则和。这是我到目前为止:htaccess的查询字符串重定向不工作
RewriteCond %{QUERY_STRING} ^(property=1234)
RewriteRule ^$ /for-sale/property-name/? [R=301,L]
这是行不通的。我可以将?property = 1234重定向到for-sale/property-name /,但是如何使它在/ for-sale /在未重定向的URL中工作?我已经尝试了RewriteRule中的各种待售组合,但没有成功。 谢谢。 我所有的链接现在都被打破了,所以我会非常感谢一些建议。谢谢。
不,它是由WordPress生成的,来自'register_post_type'中的'rewrite'参数。我发现了问题并修复了它,请参阅下面的答案。 – ardmark