Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Location
    Griffith. Australia
    Posts
    138
    Thanks
    4
    Thanked 4 Times in 4 Posts

    Question Simulate HTTP error

    I am writing software that needs to be able to recognize when HTTP error codes are received. I was wanting to know if it is possible with a .htaccess file or similar to force the webserver to send an error code instead of the requested page html.

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Easy in PHP.
    PHP Code:
    <?php
    header
    ("HTTP/1.0 404 Not Found");
    include(
    "http://mysite.com/my404.php");
    ?>


  •  

    Posting Permissions

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