Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
what do you get if you dump the CGI scope?
Copy link to clipboard
Copied
I don't get the original path in Script_Name, Path_Info, or Querystring. Really, nothing that tells me that a 404 occured,
Copy link to clipboard
Copied
Is jakarta (virtual directory) added in your website under IIS?
Copy link to clipboard
Copied
Yes. I should also mention that this legacy app still uses Application.cfm, so I can't use the OnMissingTemplate function of Application.cfc
Copy link to clipboard
Copied
I came across CF10 and custom 404 issue. This might help.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi. That doesn't solve my issue. The CGI.Querystring is still returning 404;http://my.dev.server.com:80/jakarta/isapi_redirect.dll
Copy link to clipboard
Copied
Just for testing purpose, can you add a new site in IIS. Configure connector with that website using wsconfig and place the 404.cfm in this website's root. Add jakarta as virtual directory under this new site if it is not there (it will show up as you will configure the connector for this website). Follow the above steps and then share your findings.
Copy link to clipboard
Copied
@vishu#13, I did what you suggested. Same thing. The CGI.query_string returns 404;http://my.dev.server.com:80/jakarta/isapi_redirect.dll
Copy link to clipboard
Copied
Wow, Interseting Sometimes you try your level best to reproduce but at the end of the day you end up trying it
Is it possible to install CF 10 as Development in any of the dev/test server, where you can test the same?
Also, can you provide the screenshot of IIS installed role services
Thanks
VJ
Copy link to clipboard
Copied
Here you go
Copy link to clipboard
Copied
These are the role services for IIS. As IIS is your webserver, so choose IIS, expand all the features of IIS and then provide it's screenshot.
Copy link to clipboard
Copied
How about this one?
Copy link to clipboard
Copied
Thank you for sharing. Just tested with same IIS role services in both (Server 2003/2008) and then installed CF 10. Still not able to repro it. If possible, can you test the same like if you can perform the test on a VM server 2008?
This is my web.config
<?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>
P.S : I was testing a 404.cfm as a template for 404 error in IIS. so sorry about that in the above
Can you share your web.config, if possible?
Thanks
VJ
Copy link to clipboard
Copied
Did you ever figure this out?
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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-r... which has a possible solution.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Was this ever resolved? Update 11 got us closer with using our custom 404, but then we hit this issue.
Copy link to clipboard
Copied
I never found a solution...Very frustrating.
Copy link to clipboard
Copied
@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!
Copy link to clipboard
Copied
This broke the 404 even more for me.
Right now I can do a simple 404, if the directory doesn't exsist or a file doesn't exsist.
Obviously I can't use query_string to do anything more complex. Nothing in the cgi scope is useful.
Added
<httpErrors existingResponse="PassThrough" />
and I don't even hit my custom 404.
Copy link to clipboard
Copied
James, please paste your web.config here. Is the "Missing template handler" defined in the CF Admin, and does it point to a valid 404 template e.g. /404.cfm? Also, when you say a file doesn't exist, do you mean a .cfm file or any file type e.g. a .html file?