Convert Microsoft rewrite rules to iRule
Hello,
I would like to convert Microsoft rewrite rules to iRule :
<rewrite>
<rules>
<rule name="rule1" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions trackAllCaptures="true" logicalGrouping="MatchAll">
<add input="{HTTP_USER_AGENT}" pattern="(google|bot|spider|pinterest|crawler|archiver|flipboardproxy|mediapartners|facebookexternalhit|insights|quora|whatsapp|slurp)" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="https://www.domain.com{REQUEST_URI}" appendQueryString="false"/>
</rule>
<rule name="rule2" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions trackAllCaptures="true" logicalGrouping="MatchAll">
<add input="{HTTP_FROM}" pattern=".+" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="https://www.domain.com{REQUEST_URI}" appendQueryString="false"/>
</rule>
</rules>
</rewrite>
Regards,
Thierry