[HELP] Error Page

Status
Not open for further replies.

Legion

Gaming Lord
Staff member
Nov 23, 2011
1,808
679
Ok, so, how do I make an error page, so like if somone goes to a certain URL and that page does not exist, how can i make an error page rather than IIS say 404 Error

Note: Not Habbo Related
 

brsy

nah mang
May 12, 2011
1,530
272
Or, you can use what Menks said above for the htaccess, and for the error page, you can make an error.php and have a code like this:
PHP:
<?php
if(isset($_GET['e'])) {
  switch($_GET['e']) {
      case 404:
          //code for the 404 error here
          break;
      //for each error (for example the 500 error) you just add another case: the number and add a break; at the end of the code for that error.
  }
}
?>

In your .htaccess, you can put something like:
ErrorDocument 404 /error.php?e=404
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
Just make a file called '404.shtml' and upload it to your web server in the root directory. Make sure it is called 404.shtml.
 
Status
Not open for further replies.

Users who are viewing this thread

Top