SharePoint Custom Access Denied Page
Creating a custom Access Denied page to match the site branding and client requirement is one of the requirement in most of the projects. In Microsoft SharePoint, it has a default Acess denied page. To customize and build our own Acess Denied page, follow the below steps.
- On the SharePoint server, navigate to : C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\LAYOUTS
- Create new folder: UserCustomPages
- From the /Layouts folder, copy AccessSenied.aspx file paste into the new folder(UserCustomPages).
- Rename the file to customAccessDenied.aspx and modify it as per the requirement, save it.
- Open SharePoint management shell
- Execute below scripts:
get-spcustomlayoutspage -webapplication "http://your-site-url"
This will show the default Access denied page used.
set-spcustomlayoutspage -Identity "AccessDenied" -RelativePath "/_layouts/15/UserCustomPages/customAccessDenied.aspx" -webapplication "http://your-site-url"
This will set the custom accessdenied page as the AccessDenied page.
get-spcustomlayoutspage -webapplication "http://your-site-url"
Execute this to verify the chnage.
Comments
Post a Comment