Question

I have written this rule

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

but for some reason when ever trying to access something with POST values never pass ex. https://mydomain.com/index.php?route=checkout/cart/add (product_id=5 this value send it with POST) i well never get product_id=5 but product_id=0. what am i missing from my rule. Thanks for your time

Was it helpful?

Solution

ok found the problem i also added DOCTYPE that was missing from my file

<!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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top