asp.net - Why is IIS 7 showing me a default 403 page? -
I have an asp.net 4.0 site, where someone tries to reach an authorized area, sign them in The page is redirected to position 403.
On my local machine, it redirects to the sign in page with 403 status. On IIS 7, I get a dirty 403 prohibited page instead of the signin page.
How can I get it to work locally on IIS 7?
There are default pages for all HTTP error codes in IIS. You can override them in IIS to redirect them to your own page.
IIS also recognizes the ASP.Net tag in web.config file and uses it before it is available, so you will need to set up your custom errors tag as follows:
& lt; CustomErrors defaultRedirect = "defaultError.aspx" mode = "on" & gt; & Lt; Error status code = "403" redirect = "my403page.aspx" /> & Lt; / CustomErrors & gt;
Hope you are what you are after. You can also use form authentication in ASP.NET to get it, it uses cookies, but works well with the scenario you describe, unless you specifically see them 403 pages There is no need to redirect.
Comments
Post a Comment