TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 07:57:40 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 143
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 80
  • Total: 80

[Tip] Create a 404 Not Found Page

Started by bluedevil, April 13, 2010, 08:55:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Did you look at your server logs? Not much we can do on this end without looking at the stuff on your server and in your configuration. If you can't see anything, I'd ask your host.

Crip

You can make those in your cPanel , or i can..
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Ken.

Update:
... it's always a good policy to check back on 'custom codes' like this one.
My custom 404 page stopped showing so while checking on why it turns out that at some point the .htaccess file was overwritten by an SMF update. Doing the code insertion resolved the issue, so it's all better now.
  O0
You can see my page HERE if you wish.

While sorting out this issue I was reminded of the following tip that I picked up on back in 2014.
I posted on the Google 'Webmaster' support forums and was told that my code was wrong and should be as follows:

QuoteHi Ken,

No, that's not correct. You should have this:

ErrorDocument 404 /FamilyForum/index.php?page=208

(You're mixing up a 301 redirect with the ErrorDocument directive.)

Also you must not include the full URL in an ErrorDocument directive or you won't get the all-important 404 status code: it will do a 302 redirect instead (which is what it does right now), which will screw your site up.

Modify as I've suggested and then check the HTTP headers to ensure it's sending a 404 code as well as serving up the 404 page:

Check the headers with one of these tools...
Live http headers (a Firefox browser addon_: https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/
Rex Swain's http viewer: http://www.rexswain.com/httpview.html
Web sniffer: http://web-sniffer.net/


After making the change to my .htaccess file the error page call works as it should. (the support helper had me run a check to see how Google was reading the page call)
You can find the support topic at this link...
https://productforums.google.com/forum/#!msg/webmasters/8KmJGnTDl4s/bwj4E9U4d-gJ
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Ken.

An interesting error is now (sometimes) popping up when logging in... when you click to log in the custom 404 error page displays. If you then click on any of the buttons in the top navigation bar the forum them behaves as expected.

Any thoughts?
We began a discussion about the issue HERE.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.