Mod rewrite 如何将此apache mod重写转换为iis web.config
我正在使用ApacheModRewrite,我有一个.htaccess重写语句。我想改用IIS服务器,并想知道是否有人可以就如何将现有的.htaccess语句转换为IIS web.config向我提供建议Mod rewrite 如何将此apache mod重写转换为iis web.config,mod-rewrite,web-config,iis-express,Mod Rewrite,Web Config,Iis Express,我正在使用ApacheModRewrite,我有一个.htaccess重写语句。我想改用IIS服务器,并想知道是否有人可以就如何将现有的.htaccess语句转换为IIS web.config向我提供建议 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.ph
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?url=$1[PT,L]
非常感谢专家的建议。对于IIS 7,您可以使用
部分。有一篇关于将.htaccess转换为web.config的优秀文章
已解决。从Microsoft web平台安装程序下载url重写。Url重写模块可以在通过用户界面指定规则时自动创建web.config。哪个版本的IIS?您好!我解决了!您可以下载url_rewrite,它将使用简单的ui规则自动创建web.config文件
<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>