Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ColdFusion 10, IIS 7.5, and custom 404 page

Explorer ,
Jul 31, 2013 Jul 31, 2013

I am attempting to setup a custom 404 error with CF10 and IIS 7.5. Previous to CF10 (and IIS 7), you can get the URL of the non-existent page via the querystring (e.g., 404;http://www.example.com/some/file.html) when the custom 404 page is processed. However, with CF10 and IIS 7.5, the querystring returns 404;http://www.example.com/jakarta/isapi_redirect.dll. Is there a way to retrieve the actual URL of the missing path, like in prior versions?

11.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 30, 2013 Oct 30, 2013

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <httpErrors>

            <remove statusCode="404" subStatusCode="-1" />

            <error statusCode="404" prefixLanguageFilePath="" path="/handler.cfm" responseMode="ExecuteURL" />

        </httpErrors>

    </system.webServer>

</configuration>

The "Missing template handler" is not defined in CF, we use the 404 error page setting in IIS.

As of right now, my test site on this server is just a basic 500 line .cfm file.

I've tested with non-exsistent directories, .html and .cfm. Everything works.

Except when I try to redirect to certain pages based on cgi.QUERY_STRING

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 30, 2013 Oct 30, 2013

Using IIS may be the reason why QUERY_STRING is missing.Why not try a custom 404 page in the CF Admin and dump the CGI scope to see what it gets?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 30, 2013 Oct 30, 2013

I will test today and post back. But as far as I know, the missing template handler is server wide. Correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 30, 2013 Oct 30, 2013

Yes it is server-wide. I suppose you could examine the CGI scope to see if you could serve different responses to different domains.

It'll be interesting to see what CGI variables it gives you, if any! If it does give you the data you need, you can use it as your new handler. We do this to give "intelligent" results to users, for example, we have an e-commerce site and it will show alternative/similar products if one is no longer available. Btw, check using a web sniffer to make sure your 404 handler actually does return a 404 error, otherwise it can cause SEO issues (if that is important to you.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 30, 2013 Oct 30, 2013

I can't seem to get the CFAdmin to accept a path for the "Missing Template Handler" Could be an issue trying to go from one partition to another.

But, I don't really see this as a viable solution. We have 39 sites on this server right now, and will add more (our other servers usually have ~100).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2013 Oct 30, 2013
LATEST

FYI  I've created a bug report for this issue earlier here:  https://bugbase.adobe.com/index.cfm?event=bug&id=3630245  You can vote on getting this fixed there.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources