Friday, March 02, 2012 11:04 PM
We are running a SharePoint 2010 publishing portal. We have configured for the handling of 404 error to redirect to a custom page at the IIS level and it works perfectly.
But we would like to redirect to another page if we encounter 404 error in a specific sub site.
If there was a 404 error in a subsite, http://www.sitename.com/sub-site1/ , then we need to redirect the page to http://www.sitename.com/sub-site1/pages/page-not-found.aspx. Is this possible to be configured in IIs 7.0?
Thanks in advance.
Saturday, March 03, 2012 3:10 AM
This can be achieved using a custom HTTP Module.
Ram Prasad Meenavalli | MCTS SharePoint 2010 | MCPD SharePoint 2010
Saturday, March 03, 2012 7:58 PM
Yes, http module was the option I had. But just wanted to explore if there was an option at IIS 7.0 level.
Thank you very much for your reply Ram.
- Edited by ManforSharePoint Saturday, March 03, 2012 7:59 PM
Sunday, March 04, 2012 2:53 PM
I assume handling of 404 error to redirect to a custom page at the IIS 7.0 Custom errors 404 are using .htm .html pages.
Your using ASP.Net for the page-not-found.aspx.
"Sharepoint Custom error Pages" Forums http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/56bdbadc-e6bc-492d-9311-ca68f414dd8e/
This has to be inserted in web.config. The page-not-found.aspx the .net Framework version and mode needs to set correctly.
<configuration> <system.web> <customErrors defaultRedirect="/404.aspx" mode="On"> <error statusCode="404" redirect="/my404error.aspx" /> <error statusCode="500" redirect="/my500error.aspx" /> </customErrors> </system.web> </configuration>Martin
- Marked As Answer by Pengyu Zhao Monday, March 12, 2012 3:54 AM