customError - 401.2 Access Denied

M

Mark

I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2,
access denied. We're using windows authentication. The error message that
is displayed by default is printed below. I'd love for it to redirect to
the 401-2_access_denied.htm file I've created in the root of my web site.
The text below is from my web.config file.

<customErrors defaultRedirect="error.htm" mode="On">
<error statusCode="401.2" redirect="401-2_access_denied.htm"/>
</customErrors>

1. I've tried a statusCode of 401, 401-2, and 401.2.
2. I've tried absolute and relative paths to the .htm file. Relative should
work just fine as the web.config and .htm file are both in the root of the
site.
3. IIS custom errors do not appear to be leveraged whatsoever in this
situation when modified.

Suggestions?

Thanks in advance.
Mark

*** ASP.NET ERROR ***

Access is denied.
Description: An error occurred while accessing the resources required to
serve this request. The server may not be configured for access to the
requested URL.

Error message 401.2.: You do not have permission to view this directory or
page using the credentials you supplied. Contact the Web server's
administrator for help.
 
N

Natty Gur

Hi,

The problem is that IIS check and found unauthorized access and redirect
to the page that set in IIS metadata. Your application not even called.
If you want to change that page you need to change IIS metadata. You can
do it by using IIS MMC. get application properties and in custom error
tab change 401.2 to your own file.

HTH


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
M

Mark

Unfortunately, I tried this technique already and it appears to have zero
impact. For the 401.2 error, I modifed the file path in IIS to be
C:\WINDOWS\Help\iisHelp\common\401-2_access_denied.htm for the virtual
directory that my project is in. The file is a very simple html error page
containing only text. It still redirects to the original error message.
Moreover, this authentication is maintained by ASP.NET in the web.config, so
I don't see how IIS's custom errors would impact this. Any other ideas? The
original thread is below.

Thanks again.

Mark Field
(e-mail address removed)

Natty Gur said:
Hi,

The problem is that IIS check and found unauthorized access and redirect
to the page that set in IIS metadata. Your application not even called.
If you want to change that page you need to change IIS metadata. You can
do it by using IIS MMC. get application properties and in custom error
tab change 401.2 to your own file.

HTH


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377

I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2,
access denied. We're using windows authentication. The error message that
is displayed by default is printed below. I'd love for it to redirect to
the 401-2_access_denied.htm file I've created in the root of my web site.
The text below is from my web.config file.

<customErrors defaultRedirect="error.htm" mode="On">
<error statusCode="401.2" redirect="401-2_access_denied.htm"/>
</customErrors>

1. I've tried a statusCode of 401, 401-2, and 401.2.
2. I've tried absolute and relative paths to the .htm file. Relative should
work just fine as the web.config and .htm file are both in the root of the
site.
3. IIS custom errors do not appear to be leveraged whatsoever in this
situation when modified.

Suggestions?

Thanks in advance.
Mark

*** ASP.NET ERROR ***

Access is denied.
Description: An error occurred while accessing the resources required to
serve this request. The server may not be configured for access to the
requested URL.

Error message 401.2.: You do not have permission to view this directory or
page using the credentials you supplied. Contact the Web server's
administrator for help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top