After you upgrade to 9.00 SP2 CU20, 9.10, or 9.10 SP1, pages that previously generated a custom 404 error now generate a file not found message.
- Locate your site's web.config file in your site root folder.
- Find the <system.web> tag.
Add the following code before the closing tag and replace pathtocustomerrorpage.aspx with the path to your actual custom error page):
<customerrors mode="On" redirectmode="ResponseRedirect" defaultredirect="~/pathtocustomerrorpage.aspx"> <error statuscode="404" redirect="~/pathtocustomerrorpage.aspx"></error> </customerrors>
NOTE: You already may have a customer error section, which you should modify accordingly.
- Find the <system.webserver> tag.
- Add the following before the closing tag:
<httperrors errormode="Custom">; <remove statuscode="404"></remove> <error statuscode="404" path="/404redirect.aspx" responsemode="ExecuteURL"></error> </httperrors>
NOTE: Alternatively, you could change to to let you see the error on the CMS server itself, which can be helpful in debugging>
- Save the web.config file.
- Open C:\Windows\System32\inetsrv\config\applicationhost.config .
- Find the element
<section name="httpErrors" overrideModeDefault="Allow"></section>
- Make sure that the value of overrideModeDefault is allow .
- Place the 404redirect.aspx file in your site root. The file can be located here .
- Edit the 404redirect.aspx file.
- Find the line of code that reads: string errorTemplate = "/pathtocustomerrorpage.aspx" .
- Edit the line by replacing pathtocustomerrorpage.aspx with the name of your custom 404 template located in your site root directory.
- Save the modified 404redirect.aspx .
- Re-evaluate the site's behavior.
Please sign in to leave a comment.