SharePoint and custom 404 Page Not Found and UTF-8 issue with Firefox

Update: April 08, 2013 | Publication: March 15, 2009 | by Andreas

Last week I had a strange behavior with an custom 404 error page I have made for my clients SharePoint application: The page was not working with Firefox.

Instead of showing the rendered page Firefox showed the HTML source of the file. The HTML file was encoded in UTF-8. You can see it in the following picture:

image

This behavior doesn’t occur always:

  • The error page renders correctly if you type
    http://moss2007/pages/defaultXYZ.aspx
  • The error page renders in a wrong way if you type
    http://moss2007/dfgdfgdfgdfg

Reason why the custom 404 error page doesn’t work with Firefox

The OOB Html page is encoded in UTF-8 and has some invisible symbols at the beginning of the file. Since you can’t see it with Visual Studio or Notepad you won’t recognize.

This is the reason why the Html isn’t rendered using Firefox. To see the symbols open command prompt, change to the directory with your file and type

type errorpage.html

Now you can see the symbols:

image 

Solution to get the custom 404 error to work with Firefox

You can edit the error HTML page using Notepad++ which can be downloaded at: Notepad++. If you open the page you can set a property to save the file without the BOM:

image 

After an iisreset you will see that the custom 404 error page is now rendered using Firefox. Please remember that this occurs only when you type the URL the following way: http://moss2007/dfgdfgdfgdfg.

Credits go here:

http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/564551ed-639b-4814-8cfd-b1fd99f85292/

Hope this helps to get this page working.


Get FREE & Advanced SharePoint Training, how-to's, tips & tricks:
Learn SharePoint

Comments (3) -

10/6/2010 8:50:02 AM #

Robin

Hi mate, thanks for posting this.. was just the solution to our same problem! ;)

Robin Netherlands Reply

9/1/2011 6:07:46 PM #

Venkat

Hi,
I have followed the MSDN article(http://support.microsoft.com/kb/941329) to create custom 404 page in SharePoint 2010.
The custom 404 page is not getting set for Application pages. For site pages, I am able to get custom 404 page.

If i provide a unknown page for example:
http://serverurl/pages/isitnewpage.aspx
I am getting the 404 custom page which i have set.

However, if i browse: http://serverurl/_layouts/myapp/isitnewpage.aspx
I am not getting the 404 custom page. I am getting the sharepoint correlation error page.

Is there any other setting to be changed.
Thanks.

Venkat India Reply

9/7/2011 8:59:00 PM #

Andreas Glaser

I would be interested in that too... does someone has a hint?

Andreas Glaser Switzerland Reply

Pingbacks and trackbacks (1)+

Add comment


Loading