我正在使用apache mod重写,并且我有一个.htaccess重写语句。我想改用IIS服务器,想知道有没有人能给我一些建议,如何把我现有的.htaccess语句转换成iis web.config。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
感谢专家的建议。
发布于 2013-07-26 07:18:44
已解决。从Microsoft web平台安装程序下载url重写。当您通过其ui指定规则时,Url重写模块可以自动创建web.config。
发布于 2013-07-24 14:19:18
对于IIS7,您将使用<system.webServer><rewrite>
节。有一篇关于将.htaccess翻译成web.config here的优秀文章
<rewrite>
<rules>
<rule name="Your Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" />
</rule>
</rules>
</rewrite>
https://stackoverflow.com/questions/17796271
复制相似问题