Results 1 to 9 of 9
  1. #1
    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?

  2. #2
    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.

  3. #3
    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

  4. #4
    Join Date
    Feb 2008
    Posts
    62
    Quote Originally Posted by cedivad View Post
    Sending the error trought the php's header function? Nginx/apache should catch it and display your error page
    How would I accomplish this?

  5. #5
    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.

  6. #6
    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)); ?>

  7. #7
    Join Date
    Feb 2008
    Posts
    62
    Quote Originally Posted by Carp View Post
    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.
    That didn't work.

    I would be happy just to know where the exact location of the 503 error file is located so I could edit it.

    Any ideas where it's located on a linux server?


  8. #8
    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

  9. #9
    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

  1. NixDot 503 error page!
    By hclloveh in forum Providers and Network Outages and Updates
    Replies: 2
    Last Post: 02-08-2012, 04:51 PM
  2. Replies: 5
    Last Post: 10-09-2011, 10:06 AM
  3. Custom Error Page...
    By rajeshprabhu in forum Hosting Security and Technology
    Replies: 1
    Last Post: 02-21-2003, 04:43 PM
  4. Custom error page to php
    By sergio in forum Hosting Security and Technology
    Replies: 11
    Last Post: 10-30-2002, 04:50 PM
  5. Custom error 404 page for NT
    By certify in forum Hosting Security and Technology
    Replies: 1
    Last Post: 06-13-2001, 01:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •