I have seen how this is possible by modifying files on the server or by using a publishing site, but I need to do this for team sites within SharePoint Online.
-
Have you activated the publishing feature ? There is OOTB PageNotFoundError page in the pages library. You can customize it like you do any publishing page.– Gautam ShethCommented Dec 31, 2016 at 18:31
-
Ah, I did not try just activating the publishing feature. That may work well. Thanks for the tip.– Kirk LiemohnCommented Jan 2, 2017 at 13:21
-
Darn, it looks like activating the publishing infrastructure does not enable the PageNotFoundError.aspx page.– Kirk LiemohnCommented Jan 6, 2017 at 18:33
-
1Also activate the web level - SharePoint server publishing feature.– Gautam ShethCommented Jan 6, 2017 at 19:45
-
That did it!!! So the answer is to activate the publishing infrastructure site collection feature AND the "SharePoint Server Publishing" site (SPWeb) feature. @GautamSheth, feel free to create an answer so I can mark it correct as I think it is easier for others to find this way (than by looking in the comments). I'll give you a couple of days and then I'll create the answer myself if you don't.– Kirk LiemohnCommented Jan 9, 2017 at 15:22
3 Answers
- Activate the SharePoint server publishing infrastructure feature from site collection settings
2. Activate the SharePoint server publishing feature
- After activating these 2 features, Pages library will be created which contains the
PageNotFoundError.aspx
page. You can customize it as per your requirement.
-
Awesome! I'm using this as a friendly redirect. If the page doesn't exist but there is an "alias" list entry, this page sends them to their site Commented Sep 13, 2019 at 13:58
You need publishing feature. If your site is created by team template, you have to activated this feature manually.
Prerequisite : you must be site collection admin.
Steps to Activate :
Activate Site Collection Features:
https://{siteURL}/_layouts/15/ManageFeatures.aspx?Scope=Site
findSharePoint Server Publishing Infrastructure
feature and hit activate.Activate Site Features:
https://{SiteURL}/_layouts/15/ManageFeatures.aspx
and findSharePoint Server Publishing
feature and hit activate.
Verify:
Go to this url : https://{SiteURL}/Pages/Forms/AllItems.aspx
and find PageNotFoundError.aspx
created with "Error" pagelayout.
Now you can change this page according to your need.
Yes, You can implement custom page not found error page without activating publishing feature! Here is how:
- Navigate to your SharePoint Online site collection, Pick any document library (E.g. "Site Assets")
- Enable Content type by: Click on Settings >> Library Settings >> Advanced Settings >> Set "Yes" for "Allow management of content types" option and click on "OK" in the bottom of the page
- In Library Settings page, under "Content Types", Click on "Add from existing site content types" link Add "Basic Page" content type to the Library.
- Now, Go back to the library >> Click on "New" >> Basic Page >> Give a name to your error page (E.g. 404) and click on "Create" Add some descriptive text and image to the page and save!
Now, You have your custom error page ready. You can use either PowerShell or SharePoint Designer methods to set the custom page not found error page for SharePoint Online!
More Info Here: https://www.sharepointdiary.com/2019/02/implement-custom-page-not-found-error-page-in-sharepoint-online.html