{"id":11322,"date":"2021-12-09T01:05:52","date_gmt":"2021-12-09T06:05:52","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11322"},"modified":"2021-12-09T01:05:54","modified_gmt":"2021-12-09T06:05:54","slug":"errordocument-404-vs-fallbackresource-apache-htaccess","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/","title":{"rendered":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu"},"content":{"rendered":"\n

As we discuss the debate of ErrorDocument 404 vs FallbackResource in Apache, it is good to note that Apache<\/a> provides the ErrorDocument directive to help you catch all types of error responses. When caught the server can redirect to a more friendly URL.<\/p>\n\n\n\n

The directive works by specifying the HTTP status code to catch and the URL to rewrite to. If you want to catch all 500 error responses, add the following line to your .htaccess file. The instructions here work on Mac, Windows<\/a>, and Linux<\/a> systems such as Ubuntu<\/a>, CentOS, Debian, RHEL, and others.<\/p>\n\n\n\n

ErrorDocument 500 \/error-500.html<\/code><\/pre>\n\n\n\n

ErrorDocument in Apache Server or VirtualHost Config<\/h2>\n\n\n\n

The ErrorDocument directive associates each type of error can be set within the virtual host that is currently defined. The only difference here is that you have to reload or restart the Apache server to apply changes<\/p>\n\n\n\n

$ sudo systemctl reload apache2<\/code><\/pre>\n\n\n\n

or<\/p>\n\n\n\n

$ sudo service apache2 reload<\/code><\/pre>\n\n\n\n

So, What About FallbackResource Directive?<\/h2>\n\n\n\n

In Apache, you can use the FallbackResource directive to set a handler for any URL that doesn’t map to anything in your filesystem, and would otherwise return HTTP 404 (Not Found). This will cause requests for non-existent files to be handled by the file specified in the directive.
Here’s an example:<\/p>\n\n\n\n

FallbackResource \/notfound-404.php<\/code><\/pre>\n\n\n\n

ErrorDocument 404 vs FallbackResource<\/h2>\n\n\n\n

Both of these directives behave similarly only that in the case of FallbackResource you do not specify the HTTP status code. The other difference is FallbackResource will not log an entry in the error logs that way you do not have to be concerned about your error logs growing too unnecessarily large.<\/p>\n","protected":false},"excerpt":{"rendered":"

As we discuss the debate of ErrorDocument 404 vs FallbackResource in Apache, it is good to note that Apache provides the ErrorDocument directive to help you catch all types of…<\/p>\n","protected":false},"author":1,"featured_media":11324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,25,27,16],"tags":[58,121,183,350,354,359,424,433,449,471,526,591,598,646],"yoast_head":"\nErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu<\/title>\n<meta name=\"description\" content=\"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu\" \/>\n<meta property=\"og:description\" content=\"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-09T06:05:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-09T06:05:54+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu\",\"datePublished\":\"2021-12-09T06:05:52+00:00\",\"dateModified\":\"2021-12-09T06:05:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\"},\"wordCount\":258,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg\",\"keywords\":[\"Apache\",\"CentOS\",\"Debian\",\"Libraries\",\"Linux\",\"MacOS\",\"Open Source\",\"Optimization\",\"Performance\",\"Programming\",\"Security\",\"Tools\",\"Ubuntu\",\"Windows\"],\"articleSection\":[\"Guides\",\"Libraries\",\"Programming\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\",\"url\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\",\"name\":\"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg\",\"datePublished\":\"2021-12-09T06:05:52+00:00\",\"dateModified\":\"2021-12-09T06:05:54+00:00\",\"description\":\"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg\",\"width\":1280,\"height\":680,\"caption\":\"ErrorDocument 404 vs FallbackResource in Apache\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu","description":"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu","og_description":"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems","og_url":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2021-12-09T06:05:52+00:00","article_modified_time":"2021-12-09T06:05:54+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu","datePublished":"2021-12-09T06:05:52+00:00","dateModified":"2021-12-09T06:05:54+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/"},"wordCount":258,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg","keywords":["Apache","CentOS","Debian","Libraries","Linux","MacOS","Open Source","Optimization","Performance","Programming","Security","Tools","Ubuntu","Windows"],"articleSection":["Guides","Libraries","Programming","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/","url":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/","name":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg","datePublished":"2021-12-09T06:05:52+00:00","dateModified":"2021-12-09T06:05:54+00:00","description":"Here we will debunk the ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu and other Linux or Windows systems","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/12\/errordocument-404-vs-fallbackresource.jpg","width":1280,"height":680,"caption":"ErrorDocument 404 vs FallbackResource in Apache"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/errordocument-404-vs-fallbackresource-apache-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"ErrorDocument 404 vs FallbackResource in Apache .htaccess on Ubuntu"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11322"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=11322"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/11324"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=11322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=11322"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=11322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}