Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get IIS 7/Coldfusion to deliver 404
    primarykey
    data
    text
    <p>So... we have a custom CMS. We have a rewrite rule that any page request (when a file doesn't exist) goes to the root/index.cfm file. There we search our DB for the page in question. If the page exists, we serve up the correct template,etc. If the page doesn't exist I want to server up a 404 page. Now I "think" I cannot do this in IIS since I need to handle the request in CF, so it has to get through. The file will always exist. When the page doesn't exist I've tried using <code>&lt;cfheader statusCode="404" &gt;</code> and then include some html, it puts <code>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</code> at the top of the page before my html. In order to get it to display the page I had to remove the 404 status code handler from IIS.</p> <p>In addition when I fetch as Google, it get's a 301. However when I view response headers in Firefox I get.</p> <pre><code>Transfer-Encoding: chunked Content-Type: text/html Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Wed, 16 Jan 2013 21:31:42 GMT 404 Not Found </code></pre> <p>I've tried a combination of redirecting and all sorts of things. I open to letting IIS handle the 404, if there is a way, but I cannot figure out how to get Coldfusion to correctly deliver a 404 so Google gets it right. Webmaster tools gets mad at me because I am delivering "Soft 404s" before this point, so I am trying to fix that.</p> <p>I've also tried setting <code>&lt;httpErrors existingResponse="PassThrough" /&gt;</code> whatever the hell that does, but didn't work either. I've been looking up other threads trying to figure this out and just can't.</p> <p>EDIT: Looking further into this, viewing the header info in both Firebug &amp; Chrome I clearly see the headers say 404. Why would Fetch as Bing and Fetch as Google say differently?</p> <p>I tested the fact that if I add .cfm to the URLs, it Fetch as Google will deliver see 404. However without the .cfm, it thinks it's 301. Firebug sees both as 404. This seems like a Google issue.</p> <p><strong>ANSWER Kind of:</strong></p> <p>So I was doing more testing this morning (Right after I added a bounty actually), and I noticed in webmaster tools, Google correctly noted one of my pages as a 404. So I started looking into it. I have an "Add Trailing Slash Rule". Google notices <code>domain.com/page</code> as a 301 (Correct I guess) to <code>domain.com/page/</code>. But it does notice <code>domain.com/page/</code> as a 404. I think using the trailing slash rule as I have it is the right way, however, should I be doing something different, or is using the redirect with the slash the "correct" way of doing things, even though Google wants to ding me for it sometimes.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload