{"id":334,"date":"2016-05-18T13:16:24","date_gmt":"2016-05-18T18:16:24","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=334"},"modified":"2017-10-10T16:02:06","modified_gmt":"2017-10-10T21:02:06","slug":"serving-custom-error-pages-from-apache","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=334","title":{"rendered":"Serving Custom Error Pages From Apache"},"content":{"rendered":"<p>At work, we are in the process of retiring an old password management web site. We want to direct users to the new site, and I don&#8217;t particularly want to handle each possible entry point an individual may have bookmarked. It seemed a lot quicker and easier to just move everything out of the directory and throw up a custom 404 page.<\/p>\n<p>I am certain that I&#8217;ve used <em>just<\/em> &#8220;ErrorDocument ### \/file.xtn&#8221; in Apache configurations to serve custom error pages, but when I set this up in our staging environment &#8230; I got the generic 404. Three days of Googling and reading Apache documentation later, and I have a configuration that actually serves a custom page when error 404 is encountered:<\/p>\n<pre>        ErrorDocument 404 \/customized-404.html\r\n        &lt;Files \"customized-404.html\"&gt;\r\n        &lt;If \"-z %{ENV:REDIRECT_STATUS}\"&gt;\r\n            RedirectMatch 404 ^\/customized-404.html$\r\n<\/pre>\n<p>Voila, a pretty page that doesn&#8217;t in any way indicate 404 \/ not found \/ etc but rather says &#8220;hey, this web site is being retired. please go over yonder to manage your password.&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At work, we are in the process of retiring an old password management web site. We want to direct users to the new site, and I don&#8217;t particularly want to handle each possible entry point an individual may have bookmarked. It seemed a lot quicker and easier to just move everything out of the directory &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,29],"tags":[31,372,373,374],"class_list":["post-334","post","type-post","status-publish","format-standard","hentry","category-system-administration","category-technology","tag-apache","tag-custom-404","tag-custom-error-page","tag-httpd-conf"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=334"}],"version-history":[{"count":4,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/334\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/334\/revisions\/338"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}