Hi,
Have you ever tried setting up the Custom Error Page in SharePoint 2010. For long time I was aware of only below such ways of setting up the Custom Error Page.
1.) Modify the web.cofig file and set the <customErrors> = "ON".
2.) Either you can set it from IIS.
3.) Programmatically set the custom 404 page.
But a another way is a much smarter way i.e. To configure SharePoint Foundation server or SharePoint Server 2010 to point to a custom 404 error Web page via File System.
- Log on to the computer that is running SharePoint Server 2010 by using an account that has administrative permissions.
- In Windows Explorer, locate the following folder:
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID - Create the custom HTML file:
- On the computer that is running SharePoint Server 2010, copy the Sps404.html file to a temporary folder.
- Rename the Sps404.html file. For example, give the file the following name:
Custom404.html - Modify the Custom404.html file to suit your needs for a custom 404 error message using an HTML editor.
Note : In sps404.html you will notice STSNavigate("/_layouts/spsredirect.aspx?oldUrl=" + requestedUrl). You need to modify the line as per you requirement , either create another .aspx page and save it in _layouts folder or can directly point to any .aspx file located on the sharepoint library. i.e. STSNavigate("http://www.mytestsite.com/about/pages/404notfound.aspx");4. Copy the Custom404.html file to the %systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID folder.Run the following PowerShell commands from the SharePoint 2010 Management Shell:$webapp =Get-SPWebApplication http://<serverUrl>:<port>$webapp.FileNotFoundPage = "Custom404.html"$webapp.update()
No comments:
Post a Comment