2013-05-17 58 views
1

我寫了這個規則URLRewriteFilter塊提交值

<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值的東西某種原因,絕對不能通過 前。 https://mydomain.com/index.php?route=checkout/cart/add(product_id = 5這個值使用POST發送)我很好,從來沒有得到product_id = 5但是product_id = 0。 我從我的規則中失去了什麼。感謝您的時間

回答

1

確定發現的問題我還添加了DOCTYPE這是從我的文件丟失

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

RULE

<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>