简体   繁体   English

WordPress Gravity在IIS7上使用漂亮的URL(url重写)形成

[英]WordPress Gravity forms with pretty url (url rewrite) on IIS7

We have an issue with a WordPress instance running on an IIS 7 server. 我们遇到了在IIS 7服务器上运行的WordPress实例的问题。 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. 但是,当使用一些额外的参数(例如?param1=1&param2=2在Gravity表单中预填充某些信息时,结果在数据库中没有条目。

If we disable the WordPress pretty URLs and add the paramaters again to URL the form works again. 如果我们禁用WordPress漂亮的URL并再次将参数添加到URL,则表单再次起作用。 So, we concluded that it has something to do with the rewrite rules. 因此,我们的结论是,它有something做的重写规则。 This is as far as our current analysis goes (and my knowledge on IIS's behavior on rewrite rules). 这是我们当前的分析(以及我对IIS在重写规则上的行为的了解)。

I added the current web.config bellow. 我在下面添加了当前的web.config。 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 不能按预期工作的路径是 - http://www.greenfields-kunstgras.nl/voetbalvelden/voetbal-kostencalculator/?utm_source=GF+NL+-+Voetbalvelden+-+Optin&utm_campaign=0b940c24f2-GF+NL+-+Voetbal+ - + EMAIL1&utm_medium =电子邮件&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 有效的路径(如果漂亮的网址关闭) - http://www.greenfields-kunstgras.nl/?page_id=2670&utm_source=GF+NL+-+Voetbalvelden+-+Optin&utm_campaign=0b940c24f2-GF+NL+-+Voetbal+-+ EMAIL1&utm_medium =电子邮件&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. 使用第一个路径时不保存任何记录。

Well you can use PHP (without mod_rewrite) for pretty URLs: This solution may help you. 那么你可以使用PHP(没有mod_rewrite)漂亮的URL:这个解决方案可以帮助你。 Rewrite URL in PHP without htaccess 在没有htaccess的情况下用PHP重写URL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM