In SharePoint 2010 I used Set-SPCustomLayoutsPage -Identity AccessDenied (...) for adding my custom Access Denied page. When I do this in SharePoint 2013 it does not take effect. If I run Get-SPCustomLayoutsPage the field has been updated, but it still redirects to the standard 401 page.

Seems like others are experiencing the same. https://stackoverflow.com/questions/15949794/sharepoint-2013-custom-pages

Has anyone been able to set custom pages?

migrated from stackoverflow.com Apr 18 '13 at 0:54

This question came from our site for professional and enthusiast programmers.


Make sure you do an IIS reset after the command to force the IIS and Sharepoint to pick up your changes

EDIT after update:

Also the Technet example for 2013 looks like this

Set-SPCustomLayoutsPage –Identity "_layouts/accessdenied.aspx" –RelativePath 
"/_layouts/custompages/myaccessdenied.aspx" –WebApplication "http://server_name/mywebapp"

So, the Identity should now be the path to the standard access denied page and not just the name of the page.

EDIT again:

Seems the Technet article is incorrect since it do mention using the page names in all other documentation except in the example..

  • Thanks. I did try iisreset, but it still doesn't work... – Engern Apr 18 '13 at 7:04
  • OK, can you type out the full command you are calling? – Robert Lindgren Apr 18 '13 at 7:49
  • The full command is Set-SPCustomLayoutsPage -Identity AccessDenied -RelativePath "/_layouts/15/MyCustomAccessDenied.aspx" -WebApplication "htp://sp/" WHen I run the command Get-SPCustomLayoutsPage I see that it updates the value correctly. – Engern Apr 19 '13 at 7:30
  • Updated my answer – Robert Lindgren Apr 19 '13 at 7:56
  • Thanks. I tried that, but it gives en exception. I think the example is wrong because -Identity is mapped to an enumerator. The Error I get is this: Cannot bind parameter 'Identity'. Cannot convert value "_layouts/accessdenied.aspx" to type "Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage". Error: "Unable to match the identifier name _layouts/accessdenied.aspx to a valid enumerator name. Specify one of the following enumerator names and try again: None, AccessDenied, Confirmation, Error, Login, RequestAccess, Signout, WebDeleted" – Engern Apr 19 '13 at 8:26

There is no official note about this, but it seems like this is a known issue. Expected to be fixed with CU in Feb, 2014.

Until then you are up with the following:

  • Create a Http handler to handle all these

  • Manually update error pages in _layouts (not recommended)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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