Mod rewrite htaccess到web.config文件rewriteCond
我有一个htaccess,它将文件夹添加到url中,并将其转换为变量。详情如下:Mod rewrite htaccess到web.config文件rewriteCond,mod-rewrite,web-config,Mod Rewrite,Web Config,我有一个htaccess,它将文件夹添加到url中,并将其转换为变量。详情如下: RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?pagina=$1 我必须将其转换为web.config xml结构化文件,其工作原理如下: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer>
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?pagina=$1
我必须将其转换为web.config xml结构化文件,其工作原理如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^([a-zA-Z0-9_-]+)$" ignoreCase="false" />
<action type="Rewrite" url="/index.php?page={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="^([a-zA-Z0-9_-]+)/$" ignoreCase="false" />
<action type="Rewrite" url="/index.php?page={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
现在,我只需要在最后一个文件夹不是特定文件夹的情况下使其工作,我在研究后尝试了此方法,但没有成功:
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" pattern="!^/diretorio/" ignoreCase="true" />
</conditions>
我发现正确的代码是:
<conditions>
<add input="{REQUEST_URI}" pattern="^/admin/" ignoreCase="false" negate="true" />
</conditions>