I am setting Error Pages
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/PageNotFound.aspx" responseMode="ExecuteURL" />
</httpErrors>
and
<customErrors mode="On" >
<error statusCode="404" redirect="/PageNotFound.aspx"/>
</customErrors>
but the thing is.....It works on only root level of my website and not when folders inside the root are accessed with some junk page names , when multiple websites or applications are hosted on IIS 7.
But When i am using this settings on IIS 5.1, it works for both scenarios.
Ne help will be appreciated....:)