{"id":324,"date":"2006-08-31T21:33:08","date_gmt":"2006-08-31T15:33:08","guid":{"rendered":"http:\/\/www.dotcomunderground.com\/blogs\/2006\/08\/31\/return-503-status-with-apache-webserver\/"},"modified":"2006-09-01T12:22:03","modified_gmt":"2006-09-01T06:22:03","slug":"return-503-status-with-apache-webserver","status":"publish","type":"post","link":"https:\/\/www.dotcomunderground.com\/blogs\/2006\/08\/31\/return-503-status-with-apache-webserver\/","title":{"rendered":"Return 503 Status with Apache Web Server"},"content":{"rendered":"<p>Over a <a href=\"http:\/\/googlewebmastercentral.blogspot.com\/2006\/08\/all-about-googlebot.html\">post<\/a> in <a href=\"http:\/\/googlewebmastercentral.blogspot.com\/\">Google Webmaster Central Blogs<\/a> Vanessa Fox stated that when your site goes down for maintenance tou should configure your server to return a status of 503 (network unavailable) rather than 200 (successful). This lets Googlebot know to try the pages again later.<\/p>\n<p>Searching for how i can make my Apache webserver return the 503 &#8211; Service Unavailable status code for a particular site on a shared hosting environment i found the following solution over <a href=\"http:\/\/wiki.splitbrain.org\/503.sh\">http:\/\/wiki.splitbrain.org\/503.sh<\/a><\/p>\n<p><strong>To return 503 (Service Unavailable) status on Apache Web Server:<\/strong><\/p>\n<p>Step 1:<br \/>\nCreate the following shellscript named 503.sh:<br \/>\n<code><\/p>\n<pre class=\"code bash\"><span class=\"co1\">#!\/bin\/sh<\/span>\r\n&nbsp;\r\ncat &lt;&lt;EOF\r\n<span class=\"search_hit\">Status<\/span>: <span class=\"nu0\"><\/span><span class=\"search_hit\">503<\/span>\r\nContent-Type: text\/html; <span class=\"re2\">charset=<\/span>iso<span class=\"nu0\">-8859<\/span><span class=\"nu0\">-1<\/span>\r\n&nbsp;\r\n&lt;!DOCTYPE html PUBLIC <span class=\"st0\">&quot;-\/\/W3C\/\/DTD HTML 3.2\/\/EN&quot;<\/span>&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;<span class=\"nu0\"><\/span><span class=\"search_hit\">503<\/span> - Service temporary unavailable&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;<span class=\"nu0\"><\/span><span class=\"search_hit\">503<\/span> - Service temporary unavailable&lt;\/h1&gt;\r\n&lt;p&gt;Sorry, this website is currently down <span class=\"kw1\">for<\/span> maintainance please\r\nretry <span class=\"kw1\">in<\/span> a few minutes&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\nEOF\r\n&nbsp;<\/pre>\n<p><\/code><\/p>\n<p>Step 2:<br \/>\nThen add this to your virtual host config:<br \/>\n<code>ScriptAlias \/  \/path\/to\/your\/503.sh\/<\/code><br \/>\n<strong>Please note the trailing slash! It\u00e2\u20ac\u2122s needed! <\/strong><\/p>\n<p>Step 3:<br \/>\nRestart Apache<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over a post in Google Webmaster Central Blogs Vanessa Fox stated that when your site goes down for maintenance tou should configure your server to return a status of 503 (network unavailable) rather than 200 (successful). This lets Googlebot know to try the pages again later. Searching for how i can make my Apache webserver [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,13],"tags":[125,28,40,126,128,307,304,29,39,127],"class_list":["post-324","post","type-post","status-publish","format-standard","hentry","category-tech","category-tips","category-tutorials","tag-apache","tag-google","tag-how-to","tag-linux","tag-networking","tag-seo","tag-tech","tag-technology","tag-tips-and-tricks","tag-unix"],"_links":{"self":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/comments?post=324"}],"version-history":[{"count":0,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}