Welcome, Guest. Please login or register.

ShoutBox!

 

Skhilled

2024-08-09, 18:19:29
Awww! Poor thing! LOL
 

Ken

2024-08-09, 09:20:52
 

Skhilled

2024-07-06, 10:33:18
 :D
 

Ken

2024-07-06, 06:40:47
Happy Saturday after the 4th of July!
 :fireworks:
 

Skhilled

2024-07-04, 20:27:02
Happy Day Off From Work!  :D
 

Ken

2024-06-25, 06:23:12
84... who knew?  laughing7
...2013 was my *magic* year
 

Skhilled

2024-06-14, 22:09:12
I hope so! LOL
 

Ken

2024-06-14, 21:41:30
My B-Day is forthcoming and maybe it will be far enough along so that I can be a regular Dancing Fool for that day!!! :banana: :2funny:
 

Ken

2024-06-14, 21:38:38
Happy Friday everyone! I'm  SOOO glad to see Friday and not just because it's the weekend, but because it marks one more day in the recovery of my foot!  laughing7

Scrubmeister

2024-04-19, 10:32:40
Good to see the site back faster than ever. :)

Recent Topics

TP Articles


Search in titles
Search in article texts

Author Topic: Custom 404 Error Page  (Read 21654 times)

0 Members and 3 Guests are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Custom 404 Error Page
« on: February 05, 2014, 01:24:11 PM »
Back in 2010 we had a custom error page set up that worked very nicely... not any more though.

The page is still in our TP Articles inventory, located HERE, but so far I'm not getting it to work for a 404 error. Over on tinyportal.net there are a couple of old topics on the subject but the info there seems to be out of date.

Any ideas?
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #1 on: February 06, 2014, 05:28:58 PM »
I have never tried to use an article for a 404 page. However, I suppose you could create one using TP and maybe just copy the code to 404.html?

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #2 on: February 06, 2014, 06:25:19 PM »
There is an SMF Mod, 'Apache Error Handler' that works and gives the 404 error page enclosed in the forum's default theme and the header, or top navigation bar. While the resulting output of the Mod works as expected it just leaves something to be desired in the way it looks.

I think that it can be edited, but still need to explore that possibility.
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #3 on: February 06, 2014, 06:52:18 PM »
Fixed it!  :hah!:

I was using bad code in the '.htaccess' document.
Once the correct code was added to the file it works great. (it's the last line in the code below.)

You can give it a test by clicking this link
www.ourfamilyforum.org/FamilyForu

Code: [Select]
RewriteOptions inherit

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/www\.ourfamilyforum\.org\/FamilyForum\/index\.php" [R=301,L]

RewriteCond %{HTTP_HOST} ^ourfamilyforum\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ourfamilyforum\.org$
RewriteRule ^/?$ "http\:\/\/www\.ourfamilyforum\.org\/FamilyForum\/index\.php" [R=301,L]

ErrorDocument 404 http://www.ourfamilyforum.org/FamilyForum/index.php?page=208
« Last Edit: February 06, 2014, 07:30:24 PM by Ken »
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #4 on: February 07, 2014, 10:31:58 PM »
Good job and GREAT error page!!! I remember those commercials! LOL

What does this part mean?

[R=301,L]

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #5 on: February 08, 2014, 04:29:40 AM »
Good job and GREAT error page!!! I remember those commercials! LOL

What does this part mean?

[R=301,L]

Thanks Steve.  :happy1:

On the [R=301,L] I'm not sure but I think that it's related to our forum name redirects... if someone types in a variation of the forum name it will still go to the site because of the redirects.
For example, type "ourfamilyforum.org" into your browser address bar and it will return/redirect to http://www.ourfamilyforum.org/FamilyForum/index.php

But... you have me curious now so me gonna have to do some research to verify the answer!  :hah!:
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #6 on: February 08, 2014, 08:53:27 AM »
I was asking because I was going to use the code on my forum and wanted to be sure and see if I needed to change that part to point to a specific page or something.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #7 on: February 08, 2014, 10:20:28 AM »
I didn't change any of the code that was already in the '.htaccess' file... just added the code string for the 404 page address.

Code: [Select]
ErrorDocument 404 http://www.ourfamilyforum.org/FamilyForum/index.php?page=208
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #8 on: February 09, 2014, 06:44:43 AM »
Ok, thanks, bro. :)

Just need to figure out how I want it to look.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #9 on: February 09, 2014, 08:32:00 AM »
 :2cool!!

Shoot me a link when you get it up. 
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #10 on: February 11, 2014, 05:21:25 PM »
@Skhilled

Steve, this information may be needed for you to correctly set your 404 redirect.


I posted on the Google 'Webmaster' support forums and was told that my code was wrong and should be as follows:

Quote
Hi 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



"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #11 on: February 12, 2014, 07:14:13 PM »
Cool! Thanks, bro! Bookmarked it as it has some other info I'd like to read up on. :)

Wait...so what the code from above be now?

Nvm, found the how-to.  :rofl2
« Last Edit: February 12, 2014, 07:26:57 PM by Skhilled »

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #12 on: February 12, 2014, 08:11:20 PM »
 :thumbup:
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #13 on: February 13, 2014, 09:00:26 AM »
Found this image but have not added the right text yet:

http://skhilled.net/smf/index.php?page=50

...since it is a food forum. Was the only one I liked so far.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #14 on: February 13, 2014, 09:29:40 AM »
Good one!  :hah!:

I like it.
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.