1

我写了这条规则

<rule>
    <condition type="request-uri" operator="notequal">^/admin/(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/(.*)(ico|gif|jpg|jpeg|png|js|css)$</condition>
    <condition type="parameter" name="route" operator="notequal"></condition>
    <condition type="method" operator='notequal'>POST</condition>
    <from>^/(.*)$</from>
    <to>/index.php?_route_=$1</to>
</rule>

但是由于某种原因,当尝试使用 POST 值访问某些东西时,永远不会通过 ex。https://mydomain.com/index.php?route=checkout/cart/add(product_id=5这个值用 POST 发送)我永远不会得到 product_id=5 但 product_id=0。我的规则中缺少什么。谢谢你的时间

4

1 回答 1

1

好的,发现问题我还添加了我的文件中缺少的 DOCTYPE

<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
    "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">

规则

<rule match-type="regex">
    <condition type="request-uri" operator="notequal">^/admin/(.*)$</condition>
    <condition type="request-uri" operator="notequal">^/(.*)(ico|gif|jpg|jpeg|png|js|css)$</condition>
    <condition type="parameter" name="route" operator="notequal"></condition>
    <condition type="method" name="POST" operator="notequal">POST</condition>
    <from>^/([a-zA-Z-_/0-9]+)$</from>
    <to>/index.php?_route_=$1</to>
</rule>
于 2013-05-30T20:33:43.550 回答