We need to follow the below steps to apply custom Access Denied page replacing the OOB application page.
Steps:
1) Create a new Application Page and name it based on your choice(for example AccessDenied.aspx)
2) Deploy this Application Page in to a different folder under Layouts, so that it wont conflict with OOB default.aspx page in the layouts folder
3) Once the page is deployed run the below powershell command/code /script to set the custom page as the login page
$WebAppURL= read-host "Enter the web application URL to which wish to set the Custom Access Denied Page"
Set-SPCustomLayoutsPage -Identity "AccessDenied" -RelativePath "/_layouts/Login/AccessDenied.aspx" -WebApplication $WebAppURL
Steps:
1) Create a new Application Page and name it based on your choice(for example AccessDenied.aspx)
2) Deploy this Application Page in to a different folder under Layouts, so that it wont conflict with OOB default.aspx page in the layouts folder
3) Once the page is deployed run the below powershell command/code /script to set the custom page as the login page
$WebAppURL= read-host "Enter the web application URL to which wish to set the Custom Access Denied Page"
Set-SPCustomLayoutsPage -Identity "AccessDenied" -RelativePath "/_layouts/Login/AccessDenied.aspx" -WebApplication $WebAppURL
No comments:
Post a Comment