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:

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