I'm having trouble making the pattern for matching the urls in a certain directory. I want to redirect users from mysite.com/posts/some-post.php to mysite.com/posts/some-post meaning that I want to remove the .php extension, but only in that directory, because I have already tried the universal rule which breaks my download urls which don't end with a .php extension
Here's the code that I'm currently using and which DOES NOT WORK
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^posts/([a-z0-9-])$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}.php" matchType="IsFile" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="{R:1}.php" />
</rule>