by
4,027 19
1
6
2,856
4
Top 1% !
Popular
Famous
Easy-to-find
Specified
OpenSource
Popularity: 5169th place
.htaccesserror-msg.php
Languagephp
LicenseMIT_X11

CUSTOM ERROR PAGE || HTTP STATUS REDIRECT

Very useful for you to point all your error pages to the same file
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/163886/CUSTOM-ERROR-PAGE----HTTP-STATUS-REDIREC?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<?php // Very useful if you point all your error pages to the same file. // File; .htaccess /*# .htaccess file. ErrorDocument 404 /error-msg.php ErrorDocument 500 /error-msg.php ErrorDocument 400 /error-msg.php ErrorDocument 401 /error-msg.php ErrorDocument 403 /error-msg.php # End of file. // File; error-msg.php */# ?> <?php $HttpStatus = $_SERVER["REDIRECT_STATUS"] ; if($HttpStatus==200) {print "Document has been processed and sent to you.";} if($HttpStatus==400) {print "Bad HTTP request ";} if($HttpStatus==401) {print "Unauthorized - Iinvalid password";} if($HttpStatus==403) {print "Forbidden";} if($HttpStatus==500) {print "Internal Server Error";} if($HttpStatus==418) {print "I'm a teapot! - This is a real value, defined in 1998";} ?>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus