icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Web Hosting Tutorials » [All] Creating Custom Error Pages!

Web Hosting Tutorials Feel free to browse or contribute.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old May 28th, 2008, 11:50 AM   #1 (permalink)
URB4N 5K1LLZ
Super #1
 
Roxy's Avatar
 
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? =)
__________________
Roxanne


Urban Roxy -Personal Blog
SH63 - the best darn shared server!
Roxy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Roxy for this great post!
Edwin (June 26th, 2008)
Old June 23rd, 2008, 5:29 PM   #2 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
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
Simple add some or all of these lines into your root [public_html] .htaccess file and it will be reflected across your entire site.

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.

__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks fury for this great post!
Roxy (June 23rd, 2008)
Old June 23rd, 2008, 5:33 PM   #3 (permalink)
URB4N 5K1LLZ
Super #1
 
Roxy's Avatar
 
Joined in Sep 2005
Lives in Orlando, FL
Hosted on SH63
2,651 posts
Gave thanks: 81
Thanked 128 times
Oh! Neat tip, thanks! =D
__________________
Roxanne


Urban Roxy -Personal Blog
SH63 - the best darn shared server!
Roxy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 26th, 2008, 5:35 PM   #4 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,370 posts
Gave thanks: 172
Thanked 40 times
Quote:
Originally Posted by Roxy View Post
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 does exist or simply putting into the address bar: http://yourdomain.com/404.shtml
Pretty neat, huh? =)
Shouldn't that be doesn't
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 26th, 2008, 5:41 PM   #5 (permalink)
URB4N 5K1LLZ
Super #1
 
Roxy's Avatar
 
Joined in Sep 2005
Lives in Orlando, FL
Hosted on SH63
2,651 posts
Gave thanks: 81
Thanked 128 times
Quote:
Originally Posted by Edwin View Post
Shouldn't that be doesn't
eek, yea. Thanks. >_<
__________________
Roxanne


Urban Roxy -Personal Blog
SH63 - the best darn shared server!
Roxy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 27th, 2008, 6:14 AM   #6 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
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>
This way, any IP addresses that are banned will still see the 403 error page and not just cause another denied access entry in the error log.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 5th, 2008, 6:25 PM   #7 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
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
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 5th, 2008, 6:48 PM   #8 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
632 posts
Gave thanks: 32
Thanked 28 times
Quote:
Originally Posted by Edwin View Post
Done the above, but when I enter a wrong address, it still gives me the standard page

404 is what it should be.
Please include the content of your .htaccess file.
__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 5th, 2008, 6:49 PM   #9 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
632 posts
Gave thanks: 32
Thanked 28 times
Or change what you have to this:

Code:
ErrorDocument 404 /404.php
__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On