将HTACCESS转换为WEB.CONFIG IIS7

时间:2015-03-08 10:25:53

标签: php iis-7

我有这个.htaccess文件。通过URL Rewrite模块将其导入IIS时,会出错。有人可以帮助将其转换为webconfig。

提前致谢

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?action=$1 [NC,L]

</IfModule>

1 个答案:

答案 0 :(得分:0)

第三个条件&#34;是符号链接&#34; IIS重写模块不支持。如果没有实现符号链接,则以下规则将是等效的:

<rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^(.+)$" ignoreCase="true" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="true" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="true" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php?action={R:1}" appendQueryString="true" />
    </rule>
  </rules>
</rewrite>
相关问题