0

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?

0

2 Answers 2

1

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..

7
  • Thanks. I did try iisreset, but it still doesn't work... Commented Apr 18, 2013 at 7:04
  • OK, can you type out the full command you are calling? Commented Apr 18, 2013 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. Commented Apr 19, 2013 at 7:30
  • Updated my answer Commented Apr 19, 2013 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" Commented Apr 19, 2013 at 8:26
0

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)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.