Results 1 to 9 of 9
Thread: Test Custom 503 Error Page?
-
03-04-2012, 02:52 PM #1Junior Guru Wannabe
- Join Date
- Feb 2008
- Posts
- 62
Test Custom 503 Error Page?
Is there a way to test your 503 error page to see what actually comes up?
-
03-04-2012, 04:14 PM #2Web Hosting Master
- Join Date
- Sep 2006
- Location
- Cardiff - United Kingdom
- Posts
- 1,569
A tricky one. I'd probably just copy the 503 error file and rename it to something non 'special' (i.e. 503test.htm) then just navigate to it via your browser.
-
03-04-2012, 04:28 PM #3Aspiring Evangelist
- Join Date
- Apr 2010
- Posts
- 386
Sending the error trought the php's header function? Nginx/apache should catch it and display your error page
-
03-04-2012, 04:32 PM #4Junior Guru Wannabe
- Join Date
- Feb 2008
- Posts
- 62
-
03-04-2012, 04:50 PM #5KM Carpenter
- Join Date
- Feb 2003
- Location
- Albany, New York
- Posts
- 3,026
Code:<?php header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 300');//300 seconds ?>
Try this and see if it works.Last edited by Carp; 03-04-2012 at 04:50 PM. Reason: Added text.
-
03-04-2012, 04:52 PM #6KM Carpenter
- Join Date
- Feb 2003
- Location
- Albany, New York
- Posts
- 3,026
I also found this class:
http://krisjordan.com/php-class-for-...e-status-codes
Then just do this:
Code:<?php header(StatusCodes::httpHeaderFor(503)); ?>
-
03-05-2012, 01:06 PM #7Junior Guru Wannabe
- Join Date
- Feb 2008
- Posts
- 62
-
03-05-2012, 02:54 PM #8KM Carpenter
- Join Date
- Feb 2003
- Location
- Albany, New York
- Posts
- 3,026
Rewrite your own error files and then do this in .htaccess
ErrorDocument 404 /errors/notfound.html
This would cause any error code resulting in 404 to be forward to yoursite.com/errors/notfound.html
-
03-05-2012, 02:57 PM #9KM Carpenter
- Join Date
- Feb 2003
- Location
- Albany, New York
- Posts
- 3,026
.htaccess
Code:ErrorDocument 400 /errors/badrequest.html ErrorDocument 401 /errors/authreqd.html ErrorDocument 403 /errors/forbid.html ErrorDocument 404 /errors/notfound.html ErrorDocument 500 /errors/serverr.html
Last edited by Carp; 03-05-2012 at 02:58 PM. Reason: wrong spacing.
Similar Threads
-
NixDot 503 error page!
By hclloveh in forum Providers and Network Outages and UpdatesReplies: 2Last Post: 02-08-2012, 04:51 PM -
WordPress newbie: Custom 404 Error page, with Redirect to home page?
By Lanny in forum Web Design and ContentReplies: 5Last Post: 10-09-2011, 10:06 AM -
Custom Error Page...
By rajeshprabhu in forum Hosting Security and TechnologyReplies: 1Last Post: 02-21-2003, 04:43 PM -
Custom error page to php
By sergio in forum Hosting Security and TechnologyReplies: 11Last Post: 10-30-2002, 04:50 PM -
Custom error 404 page for NT
By certify in forum Hosting Security and TechnologyReplies: 1Last Post: 06-13-2001, 01:50 PM