Skip to main content
Participant
February 16, 2014
Question

404 and 301 mapping with IIS

  • February 16, 2014
  • 1 reply
  • 1636 views

Hello All,

I am very new to Coldfusion and hosting coldfusion based sites in IIS.

Recently I was trying to host 2 sites whose homepage is working fine. But the links are not functional. When spoke to the developer, as per him, there needs to be a mapping for 301 and 404 errors in IIS.

I did set a 404 error page in IIS console, with the cfm script he asked to set (/404index.cfm) as Execute URL.

But it is giving me a blank page. If this is not set, then it gives me 404 error with coldfusion stack trace.

Coldfusion is updated to the latest patch 11.

I am getting clueless on this. Can someone suggest a solution?

Thanks in advance.

Regards,

Kurian.

    This topic has been closed for replies.

    1 reply

    Inspiring
    February 16, 2014

    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?

    kurianeoAuthor
    Participant
    February 16, 2014

    Hello Aegis,


    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.

    Any ideas?

    Regards,

    Kurian.

    Inspiring
    February 16, 2014

    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"