Get in The Lost and The Found!
Posted 24th August 2009 at 05:52 AM by oZestretch
A follow up to my post 'What do you say when your not found' this short post outlines ways in which you can utilize this 'wasted reale state'.
For Wordpress users, you can utilize the theme editor and edit 404.php (404 template). If your theme is not set up with 404.php you may consider upgrading your theme or try reviewing this post.
For users of minisites, may I suggest the .htaccess method. This method involves creating (or editing if it already exists) the .htaccess file located in your root directory (the folder your ftp client first takes you to normally). If you have no .htaccess file, create one by making a new .txt file, and rename it to .htaccess. Now some software may not allow you to name a file by this name, if this is the case, create the file and name it htaccess.txt, once the file is saved, simply rename it to .htaccess
So what do you put in this file? Glad you asked.
Now, all you need to do is create the actual page that will be shown when a 404 error is found. Using your current minisite template create an offer, or links you wish to provide people to goto if they try to enter your site and receive a 404 error.
Remember to name this page 404.html and upload it to the root directory (same place as the .htaccess). If you change the name make sure you edit the .htaccess to suit the changed file name.
Keep in mind this can be used for more than just the 404 page not found error. A 403 error is caused by forbidden access, I also make a custom page for this error.
To add a custom 403 error page Example:
For Wordpress users, you can utilize the theme editor and edit 404.php (404 template). If your theme is not set up with 404.php you may consider upgrading your theme or try reviewing this post.
For users of minisites, may I suggest the .htaccess method. This method involves creating (or editing if it already exists) the .htaccess file located in your root directory (the folder your ftp client first takes you to normally). If you have no .htaccess file, create one by making a new .txt file, and rename it to .htaccess. Now some software may not allow you to name a file by this name, if this is the case, create the file and name it htaccess.txt, once the file is saved, simply rename it to .htaccess
So what do you put in this file? Glad you asked.
Code:
Options +FollowSymLinks # custom error pages ErrorDocument 404 /404.html
Remember to name this page 404.html and upload it to the root directory (same place as the .htaccess). If you change the name make sure you edit the .htaccess to suit the changed file name.
Keep in mind this can be used for more than just the 404 page not found error. A 403 error is caused by forbidden access, I also make a custom page for this error.
To add a custom 403 error page
Code:
Options +FollowSymLinks # custom error pages ErrorDocument 404 /404.html ErrorDocument 403 /403.html
Total Comments 0

