News: November 30th, 2018, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.1! GET IT NOW!!!

Login  |  Register
* *
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 18, 2018, 03:43:40 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3734
  • Latest: nati9
Stats
  • Total Posts: 186794
  • Total Topics: 20608
  • Online Today: 45
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 1
Guests: 40
Total: 41

Author Topic: [How-To] Using a TinyPortal Article for your 404 Error Page!  (Read 8447 times)

0 Members and 1 Guest are viewing this topic.

Offline Ken.

  • Support Team
  • *
  • Posts: 4318
    • Our FamilyForum
[How-To] Using a TinyPortal Article for your 404 Error Page!
« on: February 14, 2014, 12:03:27 PM »
NOTE:
It is now late June 2018 and I've just discovered that my Custom 404 Page was not displaying correctly. It had dropped the navigation bar at the top of the page.
So, what was broken? The ".htaccess" had gotten the code for the redirect scrambled and needed to be corrected. I've added some notations to this topic from 2014 to help define this issue a little better.

If you have a custom page in place already and it's not displaying correctly, your .htaccess file would be a good place to check first.
Don't already have a custom page? Well, here's the information you need to get started!
  O0
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------

This is a short and simple two step how-to for using your TinyPortal Article system to set up a custom 404 error page.

As we all know the default 404 error pages are rather bland and boring so when Mick posted his '[Tip] Create a 404 Not Found Page' back in 2010 I was all over it and made a nice little page for my site and was well pleased with it.
As Mick said in his post:
Quote
Your visitors may stumble into a 404 "Not found" page on your website for a variety of reasons:

    * A mistyped URL, or a copy-and-paste mistake
    * Broken or truncated links on web pages or in an email message
    * Moved or deleted content

Confronted by a 404 page, they may then attempt to manually correct the URL, click the back button, or even navigate away from your site.

This code will actually show your forum and let them know that your forum does exists and make them to at least try again.
Then fast forward to this January when my site was reopened after it being off line for all of 2013. That's when it was discovered that my 404 error page no longer worked. So after some research this is what I came up with.

Please note that while this worked well for me, care should be taken to do backups of your database and the files involved in case you have a problem of some kind.
... be sure to use the information at the bottom of this post for help in editing files.


1/ First, make a TinyPortal Article with the content that you would like to be displayed whenever someone pulls up a 404 error page on your site.
... you can see my current article HERE.

2/ Next in your sites public html folder look for the '.htaccess' file.
... backup, backup, backup.  :)  (see the link below)
Adjust the code below to fit your new 404 error article and add the resulting code to the end of your .htaccess file.
Code: [Select]
ErrorDocument 404 /yourforumname/index.php?page=yourarticlepagenumberNOTE: this is the line of code that can get corrupted, it must not be the full url of your forum, but it should be like mine,(using your information) as seen here:
Code: [Select]
ErrorDocument 404 /FamilyForum/index.php?page=208
Now you can test your newly installed 404 error page by entering a broken address for your forum into your browser.
For mine it looks like this:
https://www.ourfamilyforum.org/FamilyForum/index.php  ... my forums address.
https://www.ourfamilyforum.org/FamilyFor   ... broken address that will take you to my 404 error page.

----------------------------------------------
----------------------------------------------
Useful Links:

1/ Google Product Forums › Webmaster Central › ... in this topic 'ets' gave me some spot on help in sorting out the code for my .htaccess file.

2/ Need an FTP file utility? My favorite is FileZilla.
If you do not have a FTP program (or don't know how to use one) you can use your hosting's control panel (such as File Manager in your cPanel) to download and upload the file. You can even use it to directly edit the file, if needed... be very cautious when using this method!

3/ Any time you do anything to your forum there is one thing that you should make part of your routine, like:

Backup... Backup... Backup!

When editing a file I generally do this;

    Make a temp folder on my desktop...
    Open the site with the FileZilla FTP utility...
    Download a copy of the file in question and place it in the temp folder...
    Then download a fresh copy into my editor and edit away...
    Go back to the site and rename the existing online copy of the file to something else, like, old_filename.php...
    Then upload the edited version of the file.

When doing several files I wait until all of them have been edited so that they can all be uploaded at the same time.

If everything is OK then I'm finished.
If its all messed up I just delete the bad file that was uploaded, rename the good one to the correct file name and the forum is back to normal.

Enjoy... Ken.
« Last Edit: June 28, 2018, 11:56:24 AM by Ken. »


...Well to be perfectly honest, in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different perspective and without being condemning of one's view's and by trying to make it objectified, and by considering each and every one's valid opinion, I honestly believe that I completely forgot what I was going to say.   ^-^

Offline Ken.

  • Support Team
  • *
  • Posts: 4318
    • Our FamilyForum
Re: [How-To] Using a TinyPortal Article for your 404 Error Page!
« Reply #1 on: June 28, 2018, 12:17:15 PM »
Yesterday I discovered the my custom 404 error page was not showing the top navigation bar, or any of the other header content. Once again the .htaccess file turns out to be the guilty party because the redirect code had become corrupted. It contained the full url for my site and that is not correct, instead it should be as shown is this code in order for the file to work correctly:
Code: [Select]
ErrorDocument 404 /FamilyForum/index.php?page=208
After doing an edit to install the correct code it now works as expected, as seen  HERE.

So, this made me think that it might be a good time to bring this topic back to the fore, in case anyone else might have an issue with their page.

Click Here to get back to the first post in this topic.
« Last Edit: June 28, 2018, 12:51:17 PM by Ken. »


...Well to be perfectly honest, in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different perspective and without being condemning of one's view's and by trying to make it objectified, and by considering each and every one's valid opinion, I honestly believe that I completely forgot what I was going to say.   ^-^