Forum Moderators: phranque

Message Too Old, No Replies

Chrome and 404s

         

rlopes

4:36 pm on Mar 4, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



So, inside my .htaccess file I have the following code:

ErrorDocument 404 /index.php


It should work perfectly right? Wrong. It does work fine on Firefox, but whenever someone reaches a 404 on my website via Chrome, he get's a "Suggestion:Search on Google:" box.

Are there any workarounds for this?

Ps: Seems that IE does the same thing, only FF respects the .htaccess directives.

[edited by: coopster at 6:20 pm (utc) on Mar 4, 2010]
[edit reason] no personal urls please [/edit]

jdMorgan

7:34 pm on Mar 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is likely not within your control as a Webmaster, as it's a client-side setting. See "Provide suggestions on navigation errors" in Google toolbar and Chrome options settings.

Be aware that a browser "doesn't have a choice" to obey or ignore .htaccess -- The .htaccess code runs for any incoming request and affects what the server sends to the browser. The browser may then choose to "do something different" based on that server response, but the server always controls what the server outputs.

This is to say that it is not the .htaccess directives that these browsers are respecting or not respecting, it is the way that they are responding to the server response that results from those .htaccess directives that is different.

If changing those browser/toolbar settings doesn't help, or if they're not set in the first place, then use the "Live HTTP Headers" add-on (or similar) for Firefox/Mozilla browsers, and examine your server's 404 error response carefully. If you don't see a 404 status response and only a 404 status response before your index.php page is served, then there's some other problem in your configuration.

I'd also advise you that serving your index.php page as the error document is a mistake, in that it will confuse visitors and may result in duplicate-content problems. A better approach is to serve a real 404 error page with useful information about the error that has occurred. Provide a prominent link to your home page, your site search facility, your HTML site map, and major category pages as/if applicable.

404 error pages don't have to be "jarring" -- They can be quite low-key and useful.

Jim