SharePoint 2013 custom access denied page

%3CLINGO-SUB%20id%3D%22lingo-sub-39848%22%20slang%3D%22en-US%22%3ESharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39848%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20a%20requriement%20wherein%20users%20who%20don't%20have%20access%20to%20our%20custom%20SP2013%20site%20should%20get%20to%20see%20a%20custom%20access%20denied%20page%20instead%20of%20the%20default%20access%20denied%20page.%20Basically%20as%20part%20of%20this%20page%2C%20we%20want%20to%20provide%20them%20a%20screen%2Fpage%20using%20which%20they%20can%20enter%20a%20few%20more%20details%20and%20request%20for%20acecss%20(triggering%20a%20workflow%20process).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20what%20would%20be%20the%20best%20approach%20this%3F%20I%20have%20already%20seen%20the%20following%20technet%20article%20wherein%20it%20discusses%20around%20this%20topic.%20However%2C%20believe%20this%20will%20affect%20the%20entire%20farm%20of%20SP2013%20i.e.%20the%20custom%20access%20denied%20page%20implemented%20using%20this%20method%20will%20be%20shown%20for%20all%20other%20sites%3F%20While%20we%20just%20want%20to%20have%20a%20custom%20access%20denied%20page%20for%20our%20own%20Site%20Collection%20(we%20can%20consider%20a%20web%20app%20as%20well%20-%20if%20it%20meets%20the%20requirement%20i.e.%20limited%20to%20the%20web%20app)%2C%20it%20should%20not%20affect%20other%20sites.%3C%2FP%3E%3CP%3E%3CA%20title%3D%22Technet%20Link%22%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F31253.sharepoint-2013-how-to-create-a-custom-access-denied-page.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F31253.sharepoint-2013-how-to-create-a-custom-access-denied-page.aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-41512%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-41512%22%20slang%3D%22en-US%22%3EMuch%20better%20approach...I%20didn't%20remember%20this%20solution...I'm%20getting%20old%20%3A-(.%20The%20only%20downside%20here%20is%20that%20it%20still%20requires%20to%20deploy%20stuff%20in%20the%20server%20side.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-41466%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-41466%22%20slang%3D%22en-US%22%3Ei.e.%20using%20SPWebApplication.UpdateMappedPage%20method%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-41465%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-41465%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20rather%20try%20the%20following%20option%2C%20looks%20to%20be%20meeting%20my%20current%20requirement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fmicrosoft.sharepoint.administration.spwebapplication.updatemappedpage.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fmicrosoft.sharepoint.administration.spwebapplication.updatemappedpage.aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Ffabdulwahab%2F2012%2F10%2F02%2Fhow-to-customize-error-page-page-not-found-and-access-denied-in-sharepoint-2010%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblogs.msdn.microsoft.com%2Ffabdulwahab%2F2012%2F10%2F02%2Fhow-to-customize-error-page-page-not-found-and-access-denied-in-sharepoint-2010%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWill%20updated%20here%20with%20the%20results...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39946%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39946%22%20slang%3D%22en-US%22%3EI%20know%20HTTPModule%20technique%20is%20quite%20dated%20and%20covered%20around%20the%20Internet...but%20think%20about%20your%20requirement%3A%20you%20want%20to%20check%2C%20no%20matter%20the%20page%20the%20user%20is%20trying%20to%20access%2C%20if%20he%20can%20acccess%20to%20the%20site%20or%20not...so%20I%20don't%20see%20how%20are%20you%20going%20to%20achive%20this%20using%20client%20side%20coding...another%20alternative%20to%20the%20HTTPModule%20is%20a%20custom%20hidden%20control%20you%20add%20to%20the%20master%20page%20of%20the%20site%20so%20enabling%2Fdisabling%20the%20specific%20feature%20will%20add%20this%20functionality%20to%20your%20sites%20or%20not%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39931%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39931%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20wondering%20if%20there%20was%20any%20better%20or%20alternative%20approach%20the%20HTTPModule%20approach%20is%20quite%20dated%20and%20requires%26nbsp%3Bdeployment%26nbsp%3Bin%20the%20server%20farm%26nbsp%3B.%20Also%2C%20we%20did%20NOT%20want%20to%20have%20a%20solution%20for%20the%20entire%20farm%2C%20instead%20just%20of%20our%20site%20collection%20or%20at%20the%20max%20for%20the%20web%20application%20containing%20the%20site%20collection.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-39894%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%202013%20custom%20access%20denied%20page%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-39894%22%20slang%3D%22en-US%22%3EOne%20of%20the%20solutions%20to%20meet%20this%20requirement%20is%20to%20implement%20en%20HTTPModule%20that%20check%20if%20the%20user%20has%20access%20to%20the%20site%20and%20if%20no%2C%20redirect%20to%20your%20custom%20page...the%20good%20thing%20of%20the%20HTTPModule%20is%20that%20you%20can%20use%20it%20for%20all%20the%20farm%3C%2FLINGO-BODY%3E
Highlighted
Contributor

We have a requriement wherein users who don't have access to our custom SP2013 site should get to see a custom access denied page instead of the default access denied page. Basically as part of this page, we want to provide them a screen/page using which they can enter a few more details and request for acecss (triggering a workflow process).

 

So, what would be the best approach this? I have already seen the following technet article wherein it discusses around this topic. However, believe this will affect the entire farm of SP2013 i.e. the custom access denied page implemented using this method will be shown for all other sites? While we just want to have a custom access denied page for our own Site Collection (we can consider a web app as well - if it meets the requirement i.e. limited to the web app), it should not affect other sites.

https://social.technet.microsoft.com/wiki/contents/articles/31253.sharepoint-2013-how-to-create-a-cu...

 

Thanks !!

 

6 Replies
Highlighted
One of the solutions to meet this requirement is to implement en HTTPModule that check if the user has access to the site and if no, redirect to your custom page...the good thing of the HTTPModule is that you can use it for all the farm
Highlighted

I was wondering if there was any better or alternative approach the HTTPModule approach is quite dated and requires deployment in the server farm . Also, we did NOT want to have a solution for the entire farm, instead just of our site collection or at the max for the web application containing the site collection.

Highlighted
I know HTTPModule technique is quite dated and covered around the Internet...but think about your requirement: you want to check, no matter the page the user is trying to access, if he can acccess to the site or not...so I don't see how are you going to achive this using client side coding...another alternative to the HTTPModule is a custom hidden control you add to the master page of the site so enabling/disabling the specific feature will add this functionality to your sites or not
Highlighted
Highlighted
i.e. using SPWebApplication.UpdateMappedPage method
Highlighted
Much better approach...I didn't remember this solution...I'm getting old :-(. The only downside here is that it still requires to deploy stuff in the server side.