Forum > Forum Features

Custom 404 Error Page

(1/5) > >>

Ken:
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?

Skhilled:
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?

Ken:
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.

Ken:
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: ---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

--- End code ---

Skhilled:
Good job and GREAT error page!!! I remember those commercials! LOL

What does this part mean?

[R=301,L]

Navigation

[0] Message Index

[#] Next page

Go to full version