View Full Version : 404 Error Page
MarcinSarasota
01-25-2006, 12:32 PM
I am trying to get Google Sitemaps to verify my site. They won't do it because -
"We've detected that your 404 (file not found) error page returns a status of 200 (OK) in the header.
This configuration presents a security risk for site verification and therefore, we can't verify your site. If your web server is configured to return a status of 200 in the header of 404 pages, and we enabled you to verify your site with this configuration, others would be able to take advantage of this and verify your site as well. This would allow others to see your site statistics. To ensure that no one can take advantage of this configuration to view statistics to sites they don't own, we only verify sites that return a status of 404 in the header of 404 pages.
Please modify your web server configuration to return a status of 404 in the header of 404 pages. Note that we do a HEAD request (and not a GET request) when we check for this. Once your web server is configured correctly, try to verify the site again. If your web server is configured this way and you receive this error, click Check Status again and we'll recheck your configuration."
How do I create a custom 404 error page?
Thank you, Marc
404 is handled via .htaccess file, to create your own 404 page edit the file and find the line:
ErrorDocument 404 /index.php?error
instead of index.php?error place a link to your custom 404 file
MarcinSarasota
01-26-2006, 03:11 AM
Forgive my ignorance but how do I create a custom 404 error page?
Can I do that in the back end?
Elton
01-26-2006, 04:58 AM
Might be worth a Google search. This site looked interesting:
http://www.thesitewizard.com/archive/custom404.shtml
boccio
01-26-2006, 10:26 AM
Marc, no worries no one knows everything :)
Elton gave you a good link, I'd just like to add that 404 is nothing but a "normal" web page that users get redirected to when non-existing URL is typed. Create plain&simple HTML page informing users that they are trying to reach a page that does not exist, and offer them choice of sitemap, search, etc... Similar to this:
http://www.word-press.net/oops.php
MarcinSarasota
01-26-2006, 11:02 PM
Thank you for the responses.
I understand that a custom 404 page is needed. I have built them on some of my other sites: www.thesarasotamls.com/oops (http://www.thesarasotamls.com/oops) for example.
The problem is that I don't know how to make the custom page with the phpwordPress software.
Marc
1. Create your own custom 404 page (i.e. oops.html)
2. put oops.html file in root of the server where phpWordPress is installed
2. edit. htaccess file in root of phpWordPress
3. place this line at the bottom:
ErrorDocument 404 /oops.html
MarcinSarasota
01-28-2006, 11:20 AM
Here is my .htaccess file
RewriteEngine On
RewriteRule ^category/([0-9]+).html/?$ index.php?category=$1 [L]
RewriteRule ^news/([0-9]+).html/?$ index.php?news=$1 [L]
RewriteRule ^news/([^<]+).html/?$ index.php?text=''&news=$1 [L]
RewriteRule ^print/([0-9]+).html/?$ print_version.php?id=$1 [L]
RewriteRule ^comments/([0-9]+).html/?$ index.php?comments=$1 [L]
RewriteRule ^author/([^<]+).html/?$ index.php?author=$1 [L]
RewriteRule ^([^<]+).html/?$ index.php?category_name=$1 [L]
RewriteRule ^([^<]+).htm/?$ index.php?text=''&news=$1 [L]
RewriteRule ^cat/([^<]+)/?$ index.php?category_name=$1 [L]
ErrorDocument 404 /404rag.html
I added the last line and uploaded 404rag.html to my public_html directory. This does not work. It still goes to this page - http://www.realestaterag.com/?error
ErrorDocument 404 /index.php?error
Shouldn't the above line be in my .htaccess file? What am I doing wrong?
MarcinSarasota
01-28-2006, 11:38 AM
Here is my .htacess file in my public_html/admin directory:
RewriteEngine Off
ErrorDocument 404 /404rag.html
I uploaded 404rag.html to my public_html/admin directory as well. No luck.
gcisnet
01-28-2006, 04:30 PM
Hi,
I use google sitemaps but have not had a problem getting them verified. That doesnt help you tho. It seems that if you try to access a non existent URL such as
www.gulf-coast.com/xxx it returns a normal 404 error and would probably redirect to your custom page, however it you try www.gulf-coast.com/xxx.html the .htaccess files mod rewrite changes it to /index.php?category_name=xxx which cause my site at least to generate the main index page....
This can also be seen in the webserver log where it initally attempts to access the xxx.html url but then does a 302 redirect to the / directory.
A .htaccess file will not solve this. Wordpress (should?) generate a header with the 404 values for none existent pages...IF desired. Its current method is not necessarily bad or un desired, but is not standard.
You "could" also work around some things by using a different extension instead of .html for pages like create a custom error page of error.htm not error.html.
As error.html "might get rewritten by mod rewrite as index.php?category_name=error"
This method used by word press is common but can lead to some unexpected behaviour (infinite loops), problems if you have a page and a category named the same.
The actual index.php page contains a check and a Location: command to the root url if $category is empty....this probably could be easily changed to generate a header status of 404 instead of a redirect...IF Desired. I am happy with the way it functions now. But I feel a custom error page should be built in to the product.
Again, since ALL files with .html extension in the document root are routed thru index.php by the .htaccess file....they always exist..at least to the webserver .. its up to the script itself to generate any appropriate 404 code for missing pages/articles.
Just my opinion.
Lloyd Kirk
boccio
01-30-2006, 01:27 PM
But I feel a custom error page should be built in to the product.
Yes, you are right. We are currently dealing with the problems of having custom pages when phpWordPress is installed in root directoy. Pages and categories are routed thru index.php by the .htaccess file, and as much as this is good in terms of having fully customizable SE Friendly URLs, it also leads to some problems like having separate static page(s) that shouldn't be routed thru index.php
Anyhow, we'll come up with a solution to this soon...
MarcinSarasota
01-31-2006, 12:21 AM
Can anyone help me get this resolved? This is taking a long time for an error page. Google still has not cached my pages after almost 30 days.
boccio
01-31-2006, 04:38 PM
Marc,
404 pages have absolutely nothing to do with deep-crawl and indexing pages on your site.
Your domain (www.realestaterag.com (http://www.realestaterag.com)) is fresh (according to whois - record was created on 26-dec-2005), and it needs some time before googlebot starts visiting him often, and includes pages in main index. Your site was last indexed (cached) on 23 Jan 2006 02:16:16 GMT, which is more than week ago. Not much you can do to get all pages indexed at this point, except bring good backlins...
MarcinSarasota
02-01-2006, 01:19 PM
I am aware that 404 error pages have nothing to do with a deep crawl by Google. My error page is preventing me from using Google sitemaps. I believe all of my pages could get cached and indexed sooner if I could get this error page resolved. Realtors will only submit articles to my site if they think they are getting a good backlink to their website.
Have you ever thought about providing a service to do little things like this for a fee? It might be useful for those of us who are not programmers and don't have the time to learn this stuff. I would rather pay a fee to get little things like this done. I am a Realtor and make more money selling houses than I will by learning php, mod rewrites, editing .htaccess files, etc.
boccio
02-01-2006, 06:44 PM
Marc,
You're right, no doubt. The current 404 page is not fully compiliant to GoogleSitemap protocol (because it returns HTTP 200), which we are currently dealing with with top priority. You'll have update to your site in next 12 hours.
Cheers
MarcinSarasota
02-03-2006, 10:51 AM
Any luck? :huh:
boccio
02-03-2006, 03:29 PM
Of course, your website is updated and GoogleSitemap compiliant 404 solution included in new bundle.
MarcinSarasota
02-03-2006, 08:38 PM
It worked! Thank you very much.
Elton
02-04-2006, 06:22 AM
Does this mean the .htaccess issue is cracked?
boccio
02-04-2006, 09:55 AM
Partly. For .htaccess 404 problem yes, as well as having all custom (non-phpWordPress) pages in root. Anything else (some subfolder, or file inside) the software is treating as article/category if SE Friendly URL option is On.
Still working on this.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.