我使用WordPress重写规则向前URL在WordPress的
我想一个URL转发到另一个最好通过像add_rewrite_rule WordPress的(),但我知道这是不可能的。 (因为它会容易得多。)
我有,我想匹配同一规则少数情况下
我想转发
http://dom.com/sale/product到http://dom.com/product
http://dom.com/sale/hierachicalproduct/product到http://dom.com/hierachicalproduct/product
http://localhost/dom.com/sale/product到http://localhost/dom.com/product
http://localhost/dom.com/sale/hierachicalproduct/product至http://localhost/dom.com/hierachicalproduct/product
我想删除“/sale”其余部分会相同。
我不想为每个案例输入单个规则。
这是我使用,但问题是这样的代码转发像
http://localhost/dom.com/sale/product到http://localhost/product 它跳过/dom.com侧
RewriteRule ^sale/(.+)$ /$1 [R=301,L]
检查此链接:http://stackoverflow.com/questions/28011358/htaccess-301-redirect-removing-part-of-url –
@hardiksolanki这是一样的我的规则。它删除dom.com –
你可以复制你的完整'.htaccess'代码吗? –