This shouldn't be a ColdFusion-related issue if I'm understanding you correctly.
All error mappings in IIS are defined in the ERROR PAGES module of IIS.
You can define a 404 there, but I don't believe you can speciy 3XX series "errors". 300 errors are "Redirection" codes (an error didn't necessarily occur, however the client must take an additional step to complete the request.). For example, if you request a page that has been cached, the server/client determines this and returns a '304 Not Modified', but it isn't an error that IIS is going to concern itself with. So his request to add a 301 (Moved Permanetly) is better handled programmatically along with the forward to the resource's updated location.
As for the 404, the path you enter is relative the the site root. So in the user's root, is there a '404index.cfm' file?
Thank you for the reply.
/404index.cfm does exists in the website root folder.
When accessing the URL, http://www.websitename.com/404index.cfm directly it does work.
But when I put this URL (only /404index.cfm) in 404 error pages section and execute a 404 URL like http://www.website.com/hello.cfm, it gives me a blank page. This is the same case for any .cfm file that is mentioned in 404 error page section of IIS. I created a test cfm file just to see if there is any coding issue with 404index.cfm.
In IIS, what is the ERROR PAGES feature set to?
It should be:
"Detailed Errors for Local Requests and Custom Error Pages for Remote Requests"
When "Detailed Errors for Local Requests and Custom Error Pages for Remote Requests" is set, it gives me 404 page with Missing template coldfusion stacktrace.
It gives me blank page when I choose CustomErrors.
You can Go to Server Settings>>Settings>> Missing Template Handler and setup the same.
To use the missing template handler with IIS, the Custom Error page of your website must be configured to use the page. For this example, we'll assume a directory name of /errorpages and a file named missingtemplate.cfm. Therefore, the path to the missing template handler will be /errorpages/missingtemplate.cfm.
The steps below explain how to configure IIS to use the template for the Custom Error page:
1. Right-click on the website in the IIS Management Console, then select Properties.
2. Select the Custom Errors tab.
3. Select the 404 in the HTTP Error column and click Edit Properties...
4. Select URL from the Message type dropdown and enter /errors/missingtemplate.cfm in the URL text box.
5. Click OK.
6. Right-click on the website again and select Properties.
7. Select the Home Directory tab and click the Configuration... button.
8. Select .cfm from the list and click the Edit button.
9. Check the "Check that file exists" checkbox.
10. Restart IIS and the ColdFusion Server.
Thank you for the reply.
I did this in IIS 5.1 with WinXP and it worked. The same I tried in a win 2003 server with IIS 6 and it didn't.
Seems so weird and I am trying to figure out why.