Drupal can generate fully themed 404 pages. However, some of these responses are for images or other resource files that are not displayed to the user.This can waste bandwidth, and also generate server load. This for this reason, drupal has Fast 404 pages that return a simple, fast 404 page for URLs matching a specific pattern.
File: sites/default/default.settings.php
Line: 485
Comment | File | Size | Author |
---|---|---|---|
#33 | html5-fast404-33.patch | 2.11 KB | Pere Orga |
#31 | html5-fast404-31.patch | 1.87 KB | Pere Orga |
#27 | html5-fast404-27.patch | 1.86 KB | kid_icarus |
#27 | interdiff.txt | 1.68 KB | kid_icarus |
#25 | html5-fast404-25.patch | 1016 bytes | kid_icarus |
Comments
Comment #1
gary4gar CreditAttribution: gary4gar commentedhere is the silly Patch that changes the DOCTYPE to HTML5
Comment #2
Everett Zufelt CreditAttribution: Everett Zufelt commentedI question why it never had a doctype in the first place, and whether we should add one now.
Comment #3
gary4gar CreditAttribution: gary4gar commentedEarlier doctype was xhtml & I have now switched it to html5. Besides, doctype is recommended for any HTML document to enforce standards mode.
Comment #4
nod_I don't see a doctype, unless it's added somewhere else that's quirksmode for you right there.
<!doctype html>
would help.Comment #5
droplet CreditAttribution: droplet commentedComment #6
gary4gar CreditAttribution: gary4gar commentedMy Bad! here is the correct version :)
Comment #7
JacinePlease write it this way, so it's consistent with html.tpl.php:
<!DOCTYPE html>
.Thanks!
Comment #8
webchickHey, I can do that! :P
Verified at http://validator.w3.org/check
Comment #9
JacineSweet :D Thanks!
Comment #11
webchickWhat the what? I am not sure how changing an HTML string causes the managed files table to not be found. :P Re-testing.
#8: html5-fast404.patch queued for re-testing.
Comment #12
webchickThere we go.
Re-RTBCing because it was RTBCed by Jacine in #9 before the random testbot freakout.
Comment #13
droplet CreditAttribution: droplet commentedRecently, I found IE served default error page to users (http://www.404-error-page.com/404-error-page-too-short-problem-microsoft...)
so if our purpose is make it faster, I think we don't need to output any custom strings. 404 error header is good enough.
Comment #14
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.
Comment #16
droplet CreditAttribution: droplet commentedAdd it back to D7
Comment #17
cweagansFixing tags per http://drupal.org/node/1517250
Comment #18
intergalactic overlords CreditAttribution: intergalactic overlords commentedTested on drupal 7 - works fine. I get following doctype:
Comment #19
webchickHm. I don't think we can backport this to D7. We can't change core's markup, or we risk breaking themes.
But thanks for uploading the patch; I'm sure someone out there will find it useful!
Comment #20
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedIt looks like the only change in the D7 version is the added doctype, which should have been there in the first place. Could this break existing themes in some way?
Comment #21
webchickYes, because existing themes are XHTML in D7.
Comment #22
andypostJust in case of changing to recommended defaults for HTML5, this could be useful to make a life a bit easy :)
Comment #23
David_Rothstein CreditAttribution: David_Rothstein commentedThe issue title here is inaccurate for the patch in #16 that was originally posted for Drupal 7... That confused me a lot :)
Since #16 just fixes a missing doctype, it actually seems like it should be backportable to me. Correct me if I'm wrong, but I think this string of HTML is impossible to theme (as in, literally impossible because there is no CSS or styles added to the page)? If so, then we don't have to worry about that either.
Comment #24
David_Rothstein CreditAttribution: David_Rothstein commentedOh, but first of all, wait. The Drupal 8 patch was actually incomplete, because there's still this left over in bootstrap.inc:
Comment #25
kid_icarus CreditAttribution: kid_icarus commentedSince #8 has already been committed, I think this should do the trick.
After the patch, this grep returns no results :)
Comment #26
David_Rothstein CreditAttribution: David_Rothstein commentedHm, wait a second, is this missing an opening
<html>
tag (after the doctype)? And same question goes for the original commit?Comment #27
kid_icarus CreditAttribution: kid_icarus commentedIndeed both patches are missing an opening
<html>
tag.It struck me as odd, but since #8 was committed I reasoned that it was done intentionally and made a similar edit. I should have listened to my inner wtf. Here is a patch which addresses #26.
Comment #28
droplet CreditAttribution: droplet commented#26, 27,
Nope. Although it may not a good habit,
<html>
start tag can be omitted in HTML5.#27 patch looks good.
Comment #29
andypost+1 to RTBC
Comment #30
catchCommitted/pushed to 8.x.
I'm going to disagree with webchick in #19 - the fast 404 pages aren't themable at all (unless you hack the variable yourself), so this should be OK to backport.
Comment #31
Pere OrgaPatch attached.
Comment #32
barraponto CreditAttribution: barraponto commentedWe shouldn't change Drupal 7 markup to HTML5, should we? It should remain XHTML.
Comment #33
Pere OrgaOk.
Comment #34
barraponto CreditAttribution: barraponto commentedLooks good to me. W3C Validator warns that it doesn't declare its encoding, but it's not an error.
Comment #35
Pere OrgaThanks.
Yes. The same warning should appear on 8.x.
But even the '404' pages of validator.w3.org (such as http://validator.w3.org/notfound) don't specify the encoding.
Comment #36
David_Rothstein CreditAttribution: David_Rothstein commentedLooks good - committed to 7.x. Thanks! http://drupalcode.org/project/drupal.git/commit/8a4df80