Skip to main content
rhpt
Known Participant
August 1, 2013
Question

ColdFusion 10, IIS 7.5, and custom 404 page

  • August 1, 2013
  • 7 replies
  • 11239 views

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?

This topic has been closed for replies.

7 replies

Participating Frequently
October 30, 2013

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.

Participating Frequently
October 29, 2013

Was this ever resolved? Update 11 got us closer with using our custom 404, but then we hit this issue.

rhpt
rhptAuthor
Known Participant
October 30, 2013

I never found a solution...Very frustrating.

Legend
October 30, 2013

@vishu#13, having a 302 redirect to a 404 error sounds a bit strange, and may not be good for SEO.

@colfaxschuyler, in your web.config, remove the httpErrors container and replace with this one tag:

<httpErrors existingResponse="PassThrough" />

Please see if that helps, at all.

Custom 404's in ColdFusion 10 are a PITA. We still can't get non .cfm templates to 404 to a custom page and Adobe just do not have a clue!

Participating Frequently
September 9, 2013

I've got the same issue.  Just curious, are you doing any URL redirection?  For me, I have IIRF running and catching all 404s so I can do custom "search engine friendly" URLs.  The issue with jakarta/isapi_redirect.dll only occurs when I try to access a non-existant .cfm file (oddly doesn't occur when dealing with folders or other file types).

rhpt
rhptAuthor
Known Participant
September 9, 2013

I have not found a solution, but Miguel-F pointed me to http://stackoverflow.com/questions/18694932/coldfusion-10-iis-non-existant-urls-that-are-cfm-files-retrieving-original-u which has a possible solution.

Participating Frequently
September 10, 2013

Thanks for the link.  I did some fiddling and found a workaround using IIRF.  I posted instructions on the stackoverflow page you posted.  I think this is a bug that Adobe should address.

Miguel-F
Inspiring
September 9, 2013

Did you ever figure this out?

p_sim
Participating Frequently
August 6, 2013
rhpt
rhptAuthor
Known Participant
August 16, 2013

I tried that, but that didn't fix it. The custom 404 works fine, it's just the redirect that's not returning what I expect.

vishu_13
Inspiring
August 16, 2013

Hi

For 404.cfm to display when access a non -exisiting .cfm and .html, you need to place the 404.cfm in both ColdFusion webroot (wwwroot) and your website's webroot.

Your web.config should look like this

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

<configuration>

    <system.webServer>

        <httpErrors errorMode="Custom">

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

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

        </httpErrors>

    </system.webServer>

</configuration>

Now when you access a non exisiting .html say http://www.adobe.com/hello.html then URL should redirect to http://www.adobe.com/404.cfm, below are the steps to follow.

If you want to do the same for site level, then go to error pages in IIS for your site

Choose Respond with a 302 direct with the 404.cfm URL placed in the webroot of your website

Hope it helps

Thanks

VJ

vishu_13
Inspiring
August 1, 2013

Is jakarta (virtual directory) added in your website under IIS?

rhpt
rhptAuthor
Known Participant
August 2, 2013

Yes. I should also mention that this legacy app still uses Application.cfm, so I can't use the OnMissingTemplate function of Application.cfc

Participating Frequently
August 1, 2013

what do you get if you dump the CGI scope?

rhpt
rhptAuthor
Known Participant
August 1, 2013

I don't get the original path in Script_Name, Path_Info, or Querystring. Really, nothing that tells me that a 404 occured,