【问题标题】:IIS Express Url Rewrite with 2 params don't work带有 2 个参数的 IIS Express Url 重写不起作用
【发布时间】:2013-10-04 09:45:23
【问题描述】:

我有这个:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <rewrite>
        <rules>
            <rule name="index/page/method to index.php?page=page&method=method">
                <match url="^index/([^/]+)/([^/]+)$" />
                <action type="Rewrite" url="index.php?page={R:1}&method={R:2}" />
            </rule>
            <rule name="index/page to index.php?page=page">
                <match url="^index/([^/]+)$" />
                <action type="Rewrite" url="index.php?page={R:1}" />
            </rule>
            <rule name="index to index.php">
                <match url="^index" />
                <action type="Rewrite" url="index.php" />
            </rule>
        </rules>
     </rewrite>
   </system.webServer>
</configuration>

当我调用 localhost 时,我得到以下信息: HTTP-Fehler 500.19 - 内部服务器错误

我的问题是第一条规则不起作用:( 当我删除第一条规则时,规则工作正常...... 有人可以帮我吗?

自己编辑: IIS 不喜欢 &... 所以我将其更改为 &amp;amp; 并且它工作正常^^

【问题讨论】:

    标签: web-config iis-express iis-8


    【解决方案1】:

    很明显你应该使用&amp;amp;,正如微软在其文章中所说的那样,

    http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-26
      • 1970-01-01
      • 2011-06-21
      • 2015-01-29
      • 2016-12-21
      • 1970-01-01
      相关资源
      最近更新 更多