Index: railties/html/500.html
===================================================================
--- railties/html/500.html	(revision 5018)
+++ railties/html/500.html	(working copy)
@@ -1,8 +1,79 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-   "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
-<body>
-  <h1>Application error</h1>
-  <p>Change this error message for uncaught exceptions in public/500.html</p>
-</body>
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+    <title>Application Error: 500</title>
+    <style type="text/css" media="screen">
+      body {
+        margin-top: 0;
+        padding: 0;
+        background-color: #f0f0f0;
+        font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana", sans-serif;
+        font-size: 13px;
+        color: #333;
+      }
+
+      #content {
+        margin: 0 auto;
+        background-color: white;
+        border: 3px solid #aaa;
+        border-top: none;
+        padding: 25px;
+        width: 700px;
+      }
+
+      #header {
+        height: 64px;
+      }
+
+      #header h1 {
+        margin: 0;
+        font-size: 28px;
+        color: #800;
+      }
+
+      #header h2 {
+        margin: 0;
+        color: #888;
+        font-weight: normal;
+        font-size: 16px;
+      }
+
+      ul {
+        padding: 0;
+        margin: .5em 0 0 1.25em;
+      }
+
+      li {
+        padding: .25em 0;
+        line-height: 1.5em;
+      }
+
+      #footer {
+        margin: 0 auto;
+        width: 700px;
+        text-align: center;
+        color: #aaa;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="content">
+      <div id="header">
+        <h1>Application error</h1>
+        <h2>Sorry, we could not complete the request due to an internal error!</h2>
+      </div>
+      <p>Despite our best efforts, problems sometimes do arise. We're probably busy fixing the problem right now!</p>
+      <p>For now, you can:</p>
+      <ul>
+        <li>Try back in a few minutes or...</li>
+        <li>If the problem persists, please contact support making note of your operating system (Windows, Mac OS, etc.), your browser (Internet Explorer, Safari, etc.), and what you were trying to do on the site.</li>
+      </ul>
+      <p>We apologize for this inconvenience!</p>
+    </div>
+    <div id="footer">
+      <p>Change this error message for exceptions thrown outside of an action <br />(like in Dispatcher setups or broken Ruby code) in public/500.html</p>
+    </div>
+  </body>
 </html>
\ No newline at end of file
Index: railties/html/404.html
===================================================================
--- railties/html/404.html	(revision 5018)
+++ railties/html/404.html	(working copy)
@@ -1,8 +1,77 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-   "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
-<body>
-  <h1>File not found</h1>
-  <p>Change this error message for pages not found in public/404.html</p>
-</body>
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+    <title>File Not Found: 404</title>
+    <style type="text/css" media="screen">
+      body {
+        margin-top: 0;
+        padding: 0;
+        background-color: #f0f0f0;
+        font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana", sans-serif;
+        font-size: 13px;
+        color: #333;
+      }
+
+      #content {
+        margin: 0 auto;
+        background-color: white;
+        border: 3px solid #aaa;
+        border-top: none;
+        padding: 25px;
+        width: 700px;
+      }
+
+      #header {
+        height: 64px;
+      }
+
+      #header h1 {
+        margin: 0;
+        font-size: 28px;
+        color: #800;
+      }
+
+      #header h2 {
+        margin: 0;
+        color: #888;
+        font-weight: normal;
+        font-size: 16px;
+      }
+
+      ul {
+        padding: 0;
+        margin: .5em 0 0 1.25em;
+      }
+
+      li {
+        padding: .25em 0;
+        line-height: 1.5em;
+      }
+
+      #footer {
+        margin: 0 auto;
+        width: 700px;
+        text-align: center;
+        color: #aaa;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="content">
+      <div id="header">
+        <h1>File not found</h1>
+        <h2>The file or resource you requested could not be found.</h2>
+      </div>
+      <ul>
+        <li>If you copied this URL from an email or document, double check to make sure it is complete and correct.</li>
+        <li>If you followed a link to this page from another site, try visiting the <a href="/" title="home page">homepage</a> to see if you can find it there.</li>
+        <li>If you followed a link from within this site, we apologize for the problem.</li>
+      </ul>
+    </div>
+    <div id="footer">
+      <p>Change this error message for pages not found in public/404.html</p>
+    </div>
+  </body>
 </html>
\ No newline at end of file
