WordPress Gravity forms with pretty url (url rewrite) on IIS7

We have an issue with a WordPress instance running on an IIS 7 server. Gravity forms are used to ask an user for there information.

When we fill the Gravity form only with information entered by the user it works like a charm. Though, when some information is prefilled in the Gravity form using some extra parameters like ?param1=1&param2=2 the result no entry in the database.

Read More

If we disable the WordPress pretty URLs and add the paramaters again to URL the form works again. So, we concluded that it has something to do with the rewrite rules. This is as far as our current analysis goes (and my knowledge on IIS’s behavior on rewrite rules).

I added the current web.config bellow. Hope that someone can give us a hand.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed">
      </httpErrors>
    <rewrite>
      <rules>
            <rule name="wordpress" patternSyntax="Wildcard">
                <match url="*"/>
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                    </conditions>
                <action type="Rewrite" url="index.php"/>
            </rule></rules>
    </rewrite>
    <directoryBrowse enabled="false"/>
  </system.webServer>
  <appSettings>
    <add key="Response.TrySkipIisCustomErrors" value="true"/>
  </appSettings>
</configuration>

The path that doesn’t work as expected is
http://www.greenfields-kunstgras.nl/voetbalvelden/voetbal-kostencalculator/?utm_source=GF+NL+-+Voetbalvelden+-+Optin&utm_campaign=0b940c24f2-GF+NL+-+Voetbal+-+Email1&utm_medium=email&utm_term=0_75d85ff960-0b940c24f2-96711629

The path that does work (if pretty urls are off)
http://www.greenfields-kunstgras.nl/?page_id=2670&utm_source=GF+NL+-+Voetbalvelden+-+Optin&utm_campaign=0b940c24f2-GF+NL+-+Voetbal+-+Email1&utm_medium=email&utm_term=0_75d85ff960-0b940c24f2-96711629#gf_2

When you follow the link the initial behavior is, in both cases, as expected. Only when the form is finalized. No records are saved when using the first path.

Related posts

Leave a Reply

1 comment