custom error pages show up sometimes
I created four custom error pages for the 401, 403, 404, and 500 errors.
I haven't figured out how to test the 500 (server error), but I have tested the others. I get the 401 and 403 every time, but 404 (File Not Found) shows up less than 50% of the time and I get probably the host 404 with links off my site. All four are listed in .htaccess at the root of the site. This is my htaccess:
ErrorDocument 401 /err/401.php
ErrorDocument 403 /err/403.php
ErrorDocument 404 /err/404.php
ErrorDocument 500 /err/500.php
The file sizes are:
401.php 3.9kb
403.php 3.8kb
404.php 20.3kb
500.php 4.0kb
The 404 is the one I am having trouble getting to show every time, and is larger than the other because it has a site search function to find similar pages to the one that caused the 404.
Any idea how I can get the 404.php page to show all the time?
Is this something i need to take up with th host?
I haven't figured out how to test the 500 (server error), but I have tested the others. I get the 401 and 403 every time, but 404 (File Not Found) shows up less than 50% of the time and I get probably the host 404 with links off my site. All four are listed in .htaccess at the root of the site. This is my htaccess:
ErrorDocument 401 /err/401.php
ErrorDocument 403 /err/403.php
ErrorDocument 404 /err/404.php
ErrorDocument 500 /err/500.php
The file sizes are:
401.php 3.9kb
403.php 3.8kb
404.php 20.3kb
500.php 4.0kb
The 404 is the one I am having trouble getting to show every time, and is larger than the other because it has a site search function to find similar pages to the one that caused the 404.
Any idea how I can get the 404.php page to show all the time?
Is this something i need to take up with th host?
Bill,
I'd try the 404 error page without the site search. If it works all the time, then you'd know the cause at least, if not the cure.
I'm guessing that the 404 error message wants to jump in as soon as it can, and since the standard server message is faster to load, it loads first. Check to see if your server can remove their standard 404 error page from your site, and that should force your page to load, no matter what.
I'd try the 404 error page without the site search. If it works all the time, then you'd know the cause at least, if not the cure.
I'm guessing that the 404 error message wants to jump in as soon as it can, and since the standard server message is faster to load, it loads first. Check to see if your server can remove their standard 404 error page from your site, and that should force your page to load, no matter what.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
www.mainsites.ca is my website, and yes, some of it is crappy.
Cliff,
Thanks for suggestion. Changing the 404 page to one without the search feature seems to have done the trick. Now to contact the host and see if they can keep their error page off my sites.
Thanks for suggestion. Changing the 404 page to one without the search feature seems to have done the trick. Now to contact the host and see if they can keep their error page off my sites.
billr wrote:
Cliff,
Thanks for suggestion. Changing the 404 page to one without the search feature seems to have done the trick. Now to contact the host and see if they can keep their error page off my sites.
Cliff,
Thanks for suggestion. Changing the 404 page to one without the search feature seems to have done the trick. Now to contact the host and see if they can keep their error page off my sites.
Bill,
It's always possible that there is an error in your search script that prevents your page from loading reliably. Is this a script that you wrote in php or is it one you got from a website search? You might want to google the script name and see if anyone else has had this issue.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
www.mainsites.ca is my website, and yes, some of it is crappy.
Cliff,
The search works each time i access the 404 page directly, and I downloaded the package from a site http://corz.org/engine?section=php
The man that created it suggested I check the error logs, but I can't seem to find error logs on my 1and1 sites.
I will google the site and see if anyone is reporting any errors.
The search works each time i access the 404 page directly, and I downloaded the package from a site http://corz.org/engine?section=php
The man that created it suggested I check the error logs, but I can't seem to find error logs on my 1and1 sites.
I will google the site and see if anyone is reporting any errors.
Try Google's Site Search. There is a free version
http://www.google.com/sitesearch/
I had no issues using with Custom 404
EG: http://www.ncfbc.com/444
http://www.google.com/sitesearch/
I had no issues using with Custom 404
EG: http://www.ncfbc.com/444
Hobbyist,
Thanks for the suggestion. I will check out the Google Site Search.
On your page, did you enter the suggested links, or is that something the page generated?
The 404 I have been trying to use generates a list of pages that appear to match the miss-entered address, and I really like that feature.
Thanks for the suggestion. I will check out the Google Site Search.
On your page, did you enter the suggested links, or is that something the page generated?
The 404 I have been trying to use generates a list of pages that appear to match the miss-entered address, and I really like that feature.
Bill,
I created the addresses. One to home and one to the sitemap.
Between the search and those 2 links it about covers it all. My custom 40's can be set up from the host cpanel. They use a 40_ .shtml file that can be downloaded to the local machine and edited in vsd and resaved to the server, overwritting the host file. Those .shtml files are called by their hidden .htaccess I believe. No need to edit the .htaccess. Pretty easy actually.
I created the addresses. One to home and one to the sitemap.
Between the search and those 2 links it about covers it all. My custom 40's can be set up from the host cpanel. They use a 40_ .shtml file that can be downloaded to the local machine and edited in vsd and resaved to the server, overwritting the host file. Those .shtml files are called by their hidden .htaccess I believe. No need to edit the .htaccess. Pretty easy actually.
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.