Avatar of Craig Lambie
Craig Lambie
Flag for Australia

asked on 

Rewrite .HtAccess rewrite to IIS challenge

Hi Experts,

I have a challenge for you... I need to convert the follow .htaccess rewrite rules to work on an IIS Server.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule file/.* s3url.php [NC,L]

Can you help?
I am thinking something like
 
<rewrite>
      <rules>
				<rule name="wordpress" patternSyntax="Wildcard">
					<match url="*" />
						<conditions>
							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
							<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
						</conditions>
					<action type="Rewrite" url="index.php" />
				</rule>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="file/.*" />
                    <conditions logicalGrouping="MatchAll">
                        <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="s3url.php" />
                </rule></rules>
    </rewrite>

Open in new window

But that doesn't work.

Thoughts?
Microsoft IIS Web ServerApache Web ServerLinux Networking

Avatar of undefined
Last Comment
Craig Lambie

8/22/2022 - Mon