Welcome, Guest. Please login or register.

ShoutBox!

 

Skhilled

2024-03-24, 09:52:09
It may be released as early as today...if we all agree on it. ;)
 

Skhilled

2024-03-24, 09:37:46
Thank you, sir!  :)
 

Ken

2024-03-24, 09:28:38
I like it. Dark themes are not my first choice, but I like the crisp, clean lines.  :thumbup:
 

Skhilled

2024-03-24, 08:56:28
The original theme is here:

https://www.jpr62.com/demos/index.php
 

Skhilled

2024-03-24, 08:53:17
You can always see the latest previews here but registration is disabled:

https://skhilled.com/cztest/index.php
 

Ken

2024-03-24, 08:50:36
Any previews yet?
 

Skhilled

2024-03-24, 08:46:18
We almost have another theme completed.  :laugh:
 

Skhilled

2024-03-24, 08:45:18
What's up, bro?  :drinking:
 

Ken

2024-03-24, 08:42:45
Hi Steve.  :)
 

Skhilled

2024-02-21, 21:11:25
I missed that one. LOL

Recent Topics

TP Articles


Search in titles
Search in article texts

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

0 Members and 1 Guest are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11658
  • 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: 8972
  • 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: 11658
  • 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: 11658
  • 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: 8972
  • 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: 11658
  • 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: 8972
  • 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: 11658
  • 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: 8972
  • 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: 11658
  • 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: 11658
  • 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: 8972
  • 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: 11658
  • 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: 8972
  • 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: 11658
  • 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.

Offline ZarPrime

Re: Custom 404 Error Page
« Reply #15 on: February 13, 2014, 11:59:35 AM »
Nice one Steve !!!  The only thing I would consider doing is maybe centering the image in the article.  Otherwise,  :thumbup: :thumbup: :thumbup:

Offline Skhilled

  • Administrator
  • *
  • Posts: 8972
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #16 on: February 14, 2014, 08:03:39 AM »
I had Les enlarge it for me so now it is bigger but still need to add the text.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11658
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #17 on: July 13, 2016, 01:34:12 PM »

Whoops!!!


Just fixing the error page, but...
Forgot about this part:

Quote
Hi Ken,

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

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


@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 Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11658
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #18 on: October 20, 2017, 11:12:45 AM »

Resurrecting this old topic because I just discovered that our super cool 404 error page was not being called up on page errors!  shocked003

Needed the code added back into the .htaccess... fixed now.  :tick:
https://www.ourfamilyforum.org/FamilyForum/index.php?page=208
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 8972
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #19 on: October 21, 2017, 06:17:57 AM »
Cool, but now it shows up when you login. LOL

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11658
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #20 on: October 21, 2017, 06:54:12 AM »
Me don't know how to fix that.  :-\
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 8972
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #21 on: October 21, 2017, 10:55:31 AM »
I just logged in and it didn't show up this time. Go figure...

EDIT: I just logged out and back in but this time I used the TP block to login and it did it.

Just did it again to me using the login in the main menu...
« Last Edit: October 22, 2017, 06:44:24 AM by Skhilled »

Offline Skhilled

  • Administrator
  • *
  • Posts: 8972
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #22 on: October 22, 2017, 02:46:52 PM »
 shocked028I have fixed this to the standard 404 page:

https://www.ourfamilyforum.org/FamilyForum/404.shtml

I've commented out the .htaccess line to the TP article. I think there may be a TP issue with it running from within .htaccess.
« Last Edit: October 22, 2017, 04:48:46 PM by Skhilled »

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11658
  • Gender: Male
  • View Gallery
Re: Custom 404 Error Page
« Reply #23 on: October 22, 2017, 03:15:50 PM »
Good deal.  :thumbup:

The new 404 page will need some navigation links added in... me can do that.  laughing7
EDIT: ... after the NASCAR race that just started!
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 8972
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: Custom 404 Error Page
« Reply #24 on: October 22, 2017, 04:48:14 PM »
LOL, I just realized that myself while sitting here cooking and playing a game.