Jump to content

404 Custom Page


Recommended Posts

I notice you can customize a 404 page in the cpanel but it seems bare bones. Can I make a page that matches my site (colors, design, etc) and connect to it somehow?

 

On another site, with a different webhost, it was as easy as creating a new page, making it 404.htm and it works.

I know many people must have asked this question, but when I did a search I didn't find an answer. Is there someplace I should go for instruction?

 

Thank you.

 

-Samantha

Link to comment
Share on other sites

Consider yourself hugged! Thank you!

 

I knew it was easy and had been addressed before. Will work with it tomorrow night.

 

-Samantha :rolleyes:

Link to comment
Share on other sites

Already done. Added the line of code to my htaccess file and poof it works fine.

 

Thank you again.

 

Now I will go back and take a look at yours, Thomas and Curtis's versions.

And will have to read that post about the htaccess file to understand what I did! But I will do that tomorrow.

 

Good night.

 

-Samantha

Link to comment
Share on other sites

Turtle, you send me to a thread that had a simple answer from Jimuni which added one line of code to htaccess, so I did! Simple. ;)

 

I did see your note that you added your HTML code to the 404 page in the cpanel, but I thought changing one line of code would be faster and also had one more issue with doing it that way: Had an image in my 404 page and wasn't sure that I could do that on a 404 page in the cpanel so I stuck with the one line change.

 

Works well. Thumbs Up

 

-Samantha

Link to comment
Share on other sites

I had a custom 404 at my old host, the page was named 404.shtml. When I moved my site here the 404 worked without using .htaccess or control panel. Don't understand why but it worked so I didn't change anything. Its not broke so why fix it.

 

curtis

Link to comment
Share on other sites

I checked my .htaccess and there is only one redirect in it. At my old host the home page had to be named main.html. This is to redirect main to index.html,has nothing to do with 404 page. Like I said I don't understand it but it works.

I don't think the .htaccess could have moved over,the htaccess was on the server,

When I set up the account here I published from my computer,didn't transfer from server to server.

 

curtis

Link to comment
Share on other sites

I had a custom 404 at my old host, the page was named 404.shtml. When I moved my site here the 404 worked without using .htaccess or control panel. Don't understand why but it worked so I didn't change anything.

It works because cPanel sites all define a custom error page at /404.shtml

 

If you supply this page on your site, it will be used.

 

If you don't have a /404.shtml page, you'll see this error:

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

So for a custom 404 error page you just build a page and name it 404.shtml and thats all. That does make it very simple. And explains why mine works without using .htaccess or the control panel.

Thanks

 

curtis

Link to comment
Share on other sites

That's what I did last night, based on a post by Jim.

 

-Samantha

Link to comment
Share on other sites

I have no entry in htaccess file,

I just pasted a page in the cpanel area for error pages.

I did this because I wanted to insert the name of the not found page, by clicking on the button above the window.

 

I guess what ever works, :P

Link to comment
Share on other sites

Turtle,

I wanted a couple of the features offered in the cpanel too: page not found url and refering url. I put them into the 404 page I made in CSB by inserting the code into insert > HTML. Best of both worlds.

 

Renamed my page 404.shtml and took out my htacess line. Works great. Take a look.

-Samantha

Link to comment
Share on other sites

Just one more then I will leave you alone.

This is the one I have for Lambert....http://www.lambertusa.com/404.htm

Functional.

 

-Sam

Link to comment
Share on other sites

like it..... might incorporate a form in mine too.

 

On Lambert's I gave a link to a form, but didn't put a form on the 404....nice idea!

 

-Sam

Link to comment
Share on other sites

I thought I would make is easy for a vistor to report a broken link

I used this for the message box

<textarea name="message" rows="7" cols="55"> page not found on the pets corner,

<!--#echo var="REQUEST_URI" -->

refering page is

<!--#echo var="HTTP_REFERER" -->

  </textarea>

 

I made a seperate one for our animal care center,

that displays

page not found on SCACC,

 

thanks for getting me off my duff <_<

Link to comment
Share on other sites

Thank you..... will play with mine when I get home tonight to add a form. Great idea.

 

-Sam

Link to comment
Share on other sites

Mitch...

Hate to say it, but I think you misspelled entrance.

 

Ok, modified mine to have a form now, with a thankyou that has links.

http://www.samisite.com/404.shtml

 

It works fine, sorta...when the page is accessed from within a subdirectory, the image doesn't show. I have a sub test-csb, but no 123:

http://www.samisite.com/test-csb/123

 

-Samantha

Link to comment
Share on other sites

Thank you.... That was it. I used this to link to the logo on my home page and now it works fine! Thumbs Up

 

<IMG SRC="../1d580580.jpg" border=0 width="128" height="88" ALT="Sami's Site logo">

 

-Samantha

Link to comment
Share on other sites

I took off the caps and now mine reads:

 

"Click here to report error and see alternative links"

 

 

Really like the built-in form idea! Pat yourself on the back for me-you done good!

-Samantha

Link to comment
Share on other sites

Turtle, just visited yours. You might want to center the buttons.

 

I decided to remove the reset button on mine-only choice is to report error (or back button)

 

I didn't realize that you could have a separate 404 for a subdomain. Never worked with one.

 

-Sam

Link to comment
Share on other sites

This has been fun.

 

So thankful I found Trellix/CSB/and now TCH!

 

This new format with a form on the 404 will come in VERY handy as I move the company site this week. Bought the site today, was sent the welcome email 13 minutes after purchasing..! Will start publishing to TCH tomorrow morning. The new format will at least make it easier for me to find out where the error is with almost no effort on the visitor's part.

 

-Samantha

Link to comment
Share on other sites

WOW you guys ! Seen some real nice, functional stuff here. Nice work. Mine have never been that cool but I always have fun making them :rolleyes:

 

In no particular order here are a few I have used in the past. Goof

 

 

(BTW - please don't yell at me for the "server error" line in the flaming 404. I was using it on my old yucky host and it usually WAS their fault!)

Link to comment
Share on other sites

A hoot!!! Sent the link to a couple friends that will love it

-Samantha

Link to comment
Share on other sites

Here is a current one I'm messing around with. I like Calvin and Hobbes so I just had to implement this one. Each error has a different comic.

 

404 error

405 error

414 error

501 error

505 error

 

 

I'm still working on it though. I would like to just have a random image comic come up instead. But who knows, next week it will be something entirely different since this is like my 10th error setup in two months. Now that I look at everyone elses it makes me want to change mine again. Head Bash

 

Mav

Link to comment
Share on other sites

Hey..thanks guys...I had to get offline because of bad lightning here.... I'm glad you guys like my error page... lol....it came to me in a blinding flash of too much coffee and too little sleep....

Link to comment
Share on other sites

Here is a current one I'm messing around with. I like Calvin and Hobbes so I just had to implement this one. Each error has a different comic.

 

404 error

405 error

414 error

501 error

505 error

 

 

I'm still working on it though. I would like to just have a random image comic come up instead. But who knows, next week it will be something entirely different since this is like my 10th error setup in two months. Now that I look at everyone elses it makes me want to change mine again. Head Bash

 

Mav

I love Calvin and Hobbes too... they're great! :huh:

Link to comment
Share on other sites

Dats because I am reworking them again and haven't put the .htaccess link in for my php errors. I'll probably get around to it later tonight. Heck I might just change the whole darned thing again. Head Bash

 

 

 

Mav

Link to comment
Share on other sites

I added a hidden textarea to the 404 form because the user can change or delete the info in the user area and it will arrive in your email as altered. This way you could just reserve the text area for comments or in my case, a lyrics request.

 

<div align=center>

<form NAME="404error" METHOD=POST ACTION="http://yoursite.com/path/tomail/">

<textarea style="position:absolute;visibility:hidden;" name="error">

<!--#echo var="REQUEST_URI" -->

is not found,

the refering page was

<!--#echo var="HTTP_REFERER" -->

</textarea>

<BR>

<textarea name="message" value="message" rows="7" cols="55">

<!--#echo var="REQUEST_URI" -->

is not found,

the refering page was

<!--#echo var="HTTP_REFERER" -->

</textarea>

<BR>

<input type="submit" value="Click to report this error">

</form>

</div>

Link to comment
Share on other sites

I had a form on my 404 page that had a textarea with information on the 404 page error using the echo command. I was allowing the visitor to comment inside the text box with the error information.

 

Then I saw a post to make the 404 info hidden. I did that.

I tried to add a second textarea so a visitor can send a comment, but I just get the hidden text 404 information, not the comment textarea.

 

How would I have both? Or is it even possible?

 

-Samantha

Link to comment
Share on other sites

Even if you took out the visible #echo var (2nd set) it should still work, here's what just came back to me:

 

On 2003-07-20 at 19:47:15,

 

The following information was submitted:

 

>From Host: 24.49.***.**

 

error = /alpha/whackofungussongs.html

 

is not found on ILP,

 

the refering page was

 

http://lyricsplayground.com/alpha/x.html

 

 

Should be comments here, showing up at the other end after I click THE BUTTON!!!!

 

You may have to change the field names in the 404 form to match fields in you mail script (if you're sending it that way)

Edited by boxturt
Link to comment
Share on other sites

hmmm.. not working.

 

I am still using the Globalscape server for my forms. I have not set up an email on my website yet....I am using their header for the form. Maybe that's the problem....

 

-Samantha

Link to comment
Share on other sites

Ok.... give it a try....I've worked on it for over an hour...and have settled for this without extra text area:

 

<form action="http://csbmail.globalscape.com/cgi-bin/csbmail/csbmail.pl" method="POST" enctype="application/x-www-form-urlencoded">

<input type="hidden" name="tlx_SortOrder" value="error">

<input type="hidden" name="tlx_FormIndex" value="2">

<input type="hidden" name="tlx_OKMessage" value="<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.samisite.com/errorthanks.htm">">

<input type="hidden" name="tlx_SendMode" value="1">

<input type="hidden" name="tlx_Subject" value="SamiSite error report form">

<input type="hidden" name="tlx_EmailTo" value="samrc2@mindspring.com">

 

<textarea  name="error" style="position:absolute;visibility:hidden;">

This page was not found:

<!--#echo var="REQUEST_URI" -->

The page you came from (referring page) is:

<!--#echo var="HTTP_REFERER" -->

</textarea>

 

<INPUT TYPE="submit" value="click to report error & see alternative links" name="tlx_send" onfocus="this.blur()" style="background-color:#C0DCC0;color:#680098;font-weight:bold">  

</form>

Tried adding this before the submit button:
<textarea name="comment" cols="40" rows="3" wrap="VIRTUAL"></textarea>

and added comment to the sort order too (as usual)

 

But I just get this response:

error: This page was not found:

/photo/123

The page you came from (referring page) is:

(none)

 

 

tlx_SortOrder: error, comment

 

 

tlx_SortOrder: error, comment <<< this is the standard response when the server can not send a field. I get error, but not comment. Tried reversing order.

 

I'm usually VERY good with forms, but this combo is a stickler for me.

 

Any suggestions??

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

I decided to create some custom error pages for my site tonight and thought the TCH family might like to see the result. BTW, Cpanel puts them in your www directory naming them 400.shtml, 401.shtml, etc. Thus, you can create them offline and just ftp them over.

 

Try About jSNMP Enterprises instead of About jSNMP Enterprises.

 

 

The error pages are ...

jim

Link to comment
Share on other sites

Oops. Looks like there is already a thread on this subject in the same forum. Just shows you that there is already a plethora of info in the TCH forums. Maybe I should not post after a 16 hour work day!

 

Moderator ... please move this to the pinned discussion.

 

Merged: by Deverill

Edited by Deverill
Link to comment
Share on other sites

  • 1 month later...

I've skinned my weblog and I use PHP to skin my error page. (http://leftofwest.org/404.php) BUT, when I tried to use the Control Panel to create a 404 with a PHP extension, nothing happened. THEN, I tried to write my own .htaccess file and got a 500 error, completely blocking me out of my site.

 

I used the same code I have with other hosts - ErrorDocument 404 http://leftofwest.org/404.php - in the .htaccess file so I'm not sure what's up.

 

Since CP insists on using .shtml (YUK!), am I going to have to create a .shtml page that then pulls in my PHP?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...