Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharePoint 404 page

Tags:

Is the best place set the 404 error page for SharePoint within the web.config customError section or is there a configuration setting on the site collection/ web application?

like image 540
Aaron Powell Avatar asked Feb 02 '09 06:02

Aaron Powell


People also ask

What does a 404 page do?

What is a 404 Page? A 404 page, or error page, is the content a user sees when they try to reach a non-existent page on our website. It's the page your server displays when it can't find the URL requested by the user. To learn more about 404 errors themselves and how they play into SEO, see our guide to crawl errors.

Why is it called Page 404?

The first 4 of the HTTP “404” actually indicates a client error like a misspelled URL or a moved page. The “0” points to a general syntax error like a spelling mistake, and the last “4” indicates the specific error in the family of “40-” errors which includes “400: Bad Request” and “403: Forbidden.”


1 Answers

please have a read at this blog

pasted:

  1. In your MOSS server, make a copy of %systemdrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033\sps404.html and call it my404.html

  2. Create a Virtual Directory in IIS under your MOSS root web application. For example /errors

  3. Create your own redirect aspx page, for example /errors/my404redirect.aspx and code your redirect logic in there. This is a normal asp.net page.
  4. In my404.html, make the following change: STSNavigate("/errors/my404redirect.aspx?oldUrl=" + requestedUrl);
  5. Create a Console Application and insert the following code and run it in MOSS server

    System.Uri webApplicationUri = new Uri(http://MyMOSSServer/); SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri); webApplication.FileNotFoundPage = "my404.html"; webApplication.Update();

  6. Now when you browse to a page that doesn't exist, you should expect to be brought to the redirected page.

like image 142
Ric Tokyo Avatar answered Oct 01 '22 21:10

Ric Tokyo