| Web Hosting Tutorials Feel free to browse or contribute. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
URB4N 5K1LLZ
Super #1
Joined in Sep 2005
Lives in Orlando, FL
Hosted on SH63
2,651 posts
Gave thanks: 81
Thanked 128 times
|
[All] Creating Custom Error Pages!
Within your cPanel there is a feature where you are able to create custom error pages for common errors that show up, such as 404's or 500 errors.
Once logged into your cPanel under the Advanced category, click on the icon that says error pages. ![]() On the next page you can choose which domains you'd like to create the error pages for. ![]() You're then taken to the page with the list of error messages, pick the one you'd like to edit. I would go for the 404 and 500 error pages. ![]() After choosing the domain and clicking on the GO button, you're taken to the "editor" page. HTML knowledge is useful for this section, but not enforced. There are also a few tags that you can use provided by cPanel. ![]() Once you are finished, scroll to the bottom and click on the save button. You're error page will be called 404.shtml (if editing the 404 page) and you can view it, by either going to a page on your server that doesn't exist or simply putting into the address bar: http://yourdomain.com/404.shtml ![]() Pretty neat, huh? =) |
|
|
|
| This user thanks Roxy for this great post! | Edwin (June 26th, 2008) |
|
|
#2 (permalink) |
|
Surpass Fan
Excelling Contributor
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
632 posts
Gave thanks: 32
Thanked 28 times
|
Additionally, you can use .htaccess to use custom error pages that are not .shtml only.
Code:
ErrorDocument 500 /errors/500.php ErrorDocument 404 /errors/404.php ErrorDocument 403 /errors/403.php ErrorDocument 401 /errors/401.php ErrorDocument 400 /errors/400.php This is useful if you want to use something like PHP to put the error message into a database so you can see where the bad links are coming from, or something like that. ![]() |
|
|
|
| This user thanks fury for this great post! | Roxy (June 23rd, 2008) |
|
|
#4 (permalink) | |
|
Surpassing Dutch
Super #1
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,370 posts
Gave thanks: 172
Thanked 40 times
|
Quote:
__________________
sh98
|
|
|
|
|
|
|
#6 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,218 posts
Gave thanks: 18
Thanked 86 times
|
You might want to add the following to your .htaccess if it is not there for your 403 error page whatever it is called:
Code:
<Files 403.shtml> order allow,deny allow from all </Files>
__________________
|
|
|
|
|
|
#7 (permalink) |
|
Surpassing Dutch
Super #1
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,370 posts
Gave thanks: 172
Thanked 40 times
|
Done the above, but when I enter a wrong address, it still gives me the standard page
![]() 404 is what it should be.
__________________
sh98
|
|
|
|
|
|
#8 (permalink) | |
|
Surpass Fan
Excelling Contributor
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
632 posts
Gave thanks: 32
Thanked 28 times
|
Quote:
|
|
|
|
|