Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Remove file extension when file and directory are named the same

$
0
0

Hello,  I am using the code below to add the aspx back for pages on my site:

<rule name="Hide-ASPX" enabled="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>

But it does not work for pages that are named the same as a directory.

So if I have:

mydomain.com\stuff\item1.aspx

and

mydomain.com\stuff.aspx

It will work for item1.aspx but errors out for stuff.aspx with a 403 access is denied because it is trying to access the directory instead of the page.

Is this possible or am I forced to either rename directories or abandon removing file extensions?

Thanks


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>