sharepoint 2010 custom 404 page not working
-
lundi 19 décembre 2011 11:02
I did try to configure a custom 404 page for sp2010 publishing site.
Based on this article (http://support.microsoft.com/kb/941329/en-us)
I did add a simple html file (sps404test.html) to this folder
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033
This is the content of the 404 file<!-- _localBinding -->
<!-- _lcid="1033" _version="" -->
<html>
<head>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
TEST 404 for mytestsite
</body>
</html>i can browse to the 404 page via this url
http://mytestsite/_layouts/1033/sps404test.htmlWith sp2010-powershell I try to set the custom 404 with these commands (no errors resturned)
$webapp =Get-SPWebApplication http://mytestsite
$webapp.FileNotFoundPage = "sps404test.html"
$webapp.update()this command allows me to check that the filenotfoundpage returns my test page
(Get-SPWebApplication http://mytestsite).FileNotFoundPageHowever... i still receive the default 404 page from sharepoint (even after app pool recycle)
I searched for interference with the web.config customErrors tag, but no succes.
Any help is welcome, thx
Toutes les réponses
-
lundi 19 décembre 2011 13:39
Hi
i want to recommend two things
1:- make sure you have placed your page "C\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033"
2: Please do a apppool recycle
:)
-----------------------------------------------------------------------------------------------------------------Manoj Gangwar | MCTS Sharepoint 2010 | MCPD Sharepoint 2010
(Please click "Marked As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you)
- Modifié Manoj.Gangwar lundi 19 décembre 2011 13:40
-
lundi 19 décembre 2011 17:08
Hi Manoj
Thx for your swift reply.
I did try already both your recommandations, but no succes
-
lundi 19 décembre 2011 17:10Try resetting IIS (iisreset). It worked for me... ;)
Ram Prasad Meenavalli | MCTS SharePoint 2010 | MCPD SharePoint 2010 -
mardi 20 décembre 2011 15:01
tried iisreset on all servers off the farm : no success
-
mardi 20 décembre 2011 18:18Can you try setting CustomErrors to "On" in your application's web.config and check...
Ram Prasad Meenavalli | MCTS SharePoint 2010 | MCPD SharePoint 2010 -
jeudi 22 décembre 2011 11:03
I tried these settings in web.config
<customErrors mode="On">
<error redirect="http://www.mysite.com/_layouts/1033/sps404ES.html" statusCode="404" />
</customErrors>and
<customErrors >
<error redirect="http://www.mysite.com/_layouts/1033/sps404ES.html" statusCode="404" />
</customErrors>AND
<customErrors mode="On">
</customErrors>.... without success
-
jeudi 3 mai 2012 11:57
I had the same problem, until I found out that the folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033 is for sites in English.
Once I put the spscustom404.html (or in your case the spstest404.html) in the folder c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1043 (Dutch language) and ran the Powershell script, my custom 404 page worked!
-
jeudi 3 mai 2012 12:04
Hi
I have seen this error in my past.
Just follow the steps given below, u can fix it easily
- 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:
%systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID
Notes
• In this path, %systemdrive% represents the actual drive name of the drive on which the operating system is installed.
• In this path, LangID represents the actual language ID of the language that you use. For example, 1033 is the language ID for U.S. English. - 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.
- 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()
Verify that the property is set by running the following command:
(Get-SPWebApplication http://<serverUrl>:<port>).FileNotFoundPage
- Modifié -vijay jeudi 3 mai 2012 12:05
- Proposé comme réponse -vijay jeudi 3 mai 2012 12:05
- Non proposé comme réponse Hemendra AgrawalMicrosoft Community Contributor, Moderator mercredi 13 mars 2013 10:32
-
samedi 2 février 2013 21:19
Hi,
To setup a custom 404 page in SharePoint 2010 you should follow the instructions in the following KB article: http://support.microsoft.com/kb/941329 (similar as the previous post).
NOTE: If you are using Internet Explorer, you may experience that the browser is NOT showing you your newly setup 404 page (but instead you will see the default Page not Found page), this is because IE will only display/render the response body if the message size is more than 512 bytes (!).
If this is the case, you should test the same page with a different browser (FireFox or Chrome both will show you the custom 404 page).
To fix, simply make sure your custom 404 page is larger than 512 bytes, you can use the IE developer toolbar (F12), then select (click) the Network tab, click Start capturing, then refresh your page request, click on Go to Detailed View. The Response Body will show you your 404 custom page, you can also find the message size.
I hope this will help someone, as it took me a little while to figure this out.
Thanks,
Yuri Lausberg, MCP, MCAD, MCSD, MCTS, MCPD
- Modifié Yuri Lausberg samedi 2 février 2013 21:20

