Question

I have this rule in web.config.

<rule name="RewriteSourceCategorySuburb" stopProcessing="true">
  <match url="(news)$" />
  <conditions  logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  </conditions>
  <action type="Rewrite" url="default.aspx?category={R:1}" />
</rule>

The problem is I have the folder name called "news" in my root and it doesn't even have default.aspx in that folder but the web server is trying to view the folder "news" and shows this error "403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied." when I request mysite.com/news. Is it possible to make my rule to be processed higher than that folder name? Thanks.

Note: It is not just news folder it is happening all name with the same folders, I need to change a lot to rename those folders to something else. Please help. :(

Was it helpful?

Solution

I ran into a similar issue last month, and it ended up being an authentication setting within IIS. One thing you could check is the authentication settings in IIS, and change Anonymous Authentication to use the Application Pool Identity instead of the default, "IUSR".

You also need to have the URL rewrite module installed where your IIS is installed, here is a link http://www.iis.net/downloads/microsoft/url-rewrite

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top