I have this htaccess wich gets the folder added in the url and converts it into a variable. As follows:
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?pagina=$1
I had to convert it to a web.config xml sctructured file, It worked like this:
<?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>
Now I need to make it work only when this last folder is not an specific folder, I tried this after a research but no success:
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" pattern="!^/diretorio/" ignoreCase="true" />
</conditions>
I found out the correct code is: