SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some reasons i find my self facing this request : Making a redirect from : /_Layouts/AccessDenied.aspx to a Custom ApplicationPage and the modification MUST be done ONLY on web.config which means that i can't use

UpdateMappedPage(SPWebApplication.SPCustomPage.AccessDenied, customAccessDeniedPage)

or any of the solutions on this site

After some research i tried to add this :

<customErrors mode="On" defaultRedirect="~/_layouts/AccessDenied.aspx">
<error redirect="~/_layouts/MySite/Pages/AccessDenied.aspx" statusCode="401" />
<error redirect="~/_layouts/MySite/Pages/AccessDenied.aspx" statusCode="403" />

And this :

<httpErrors errorMode="Custom" existingResponse="Auto">

but it didn't make a redirect, even if, under the IIS --> MySite the redirect exist !

share|improve this question
up vote 0 down vote accepted

I don't think it can be done. I'm pretty sure the sharepoint httpmodule is what redirects for errors and accessdenied pages. So it ignores what's in the web.config.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.