Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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" />
</customErrors>

And this :

<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Auto">
</httpErrors>

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

share|improve this question

1 Answer 1

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

 
discard

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.