Scott, I gave up on the idea of changing the links on my page (too many!) and just went with an html page and following the directions of the hosting service put ErrorDocument 404 /missing.html (missing being the name of my 404 page) in .htaccess
The Header Checker tool returns it as a “SERVER RESPONSE: HTTP/1.1 404 Not Found” and i do get a title on the page as it’s an html page that i put “404 - not found” as the title. But since it’s getting the 404 response there, as well as Google Webmaster tools 'Fetch as Google" also returns a “Not Found” that means it is working correctly, no?
Also a ‘bad url’ returns a 404 in the header checker.
I would ask your host or look around in whatever control panel you have for error page configuration. In Cpannel, you can just put text in, use some provided macros or just past in some html (which is what I did).
I’ll throw some comments in the code and send it to you, it’s pretty simple down & dirty.
Cynthia it wasn’t your fault - you provided the inspiration for a solution! And as i said, I know I learned a lot from all the helpful people in the thread, so for me it was all a positive experience. So thanks to everyone who participated! And who knows - perhaps a solution will be found in the future.
Well, I still feel like I started a big mess, but thank you for saying what you did! I do feel like you however, that I learned a lot from this, and all the great, helpful people in this thread! Everyone seems so talented and helpful, and I appreciate them so much! And yes, I do hope a solution will be found, or created in RW. Thank You!
Hi -
Thanks very much for the solution and great instructions. Now for my dumb question:
I followed the directions, made my pages and the redirection is working fine, but I’m still not clear as to what responses i should see when i run the 404.html page through google webmaster tools “Fetch as Google”. When i run 404.html through it i get “Complete”, if I run a ‘bad URL’ i get ‘Not Found’ and when i run 404redirected.html i get “Complete”.
Are those the correct responses for a valid 404 page?
I’m no SEO guru by any stretch of the imagination, but…
404.html exists so it resolves.
404redirected.html exists so it will resolve.
These are just html web pages that exist so referencing them directly will always resolve.
Referencing a bad url in your domain will never resolve and always return “file not found” which in your server environment will trigger a 404 response, and in turn your htaccess file will trigger the loading of the 404.html in response to that, which in turn now bounces to present 404redircted.html
I’m no SEO guru either but I can explain the basic concept
Google expects/demands that a proper response code is returned from the server when someone searches for a web page, there are a whole list of them but for now we’re talking about just a couple.
If a user clicks on a link or types in a url to a nonexistent page the server needs to send a response code 404 - Not Found
So how does that happen?
Your web server cant find the page so it follows the .htaccess rules
If there is an ErrorDocument 404 /SomeFileName the server sends a 404 response code back then sends the file to your browser done deal normally. BUT because of the relative path thing problem causing page elements not to load is our case, we need to both send a 404 AND then load a useable page.
The 404.html page is simply a blank page that doesn’t display anything because of the CSS display:none statement it runs the Javascript code that then asks for the 404redirect page (I called mine 404Recovery).
Request for bad page ===> server doesn’t have page===> .htaccess rule===>send 404 response===> load 404.html===>404.html (displays nothing) ===> 404.html request 404Recovery===>404Recovery loads (sends 200 OK response ===> nice fully styled error page for user with navigation.
Here is a screen shot of the server response codes for mine: Notice a 404 response code is sent for the non existent page and a 200 for the recovery page. Google should be happy it got the right responses, users should be happy they have a chance to find what they are after.
Note: it’s also possible that a 304 cached code may also be returned from the 404recovery page that’s okay too.
Thanks for putting up with my density Scott. That was very thorough indeed! Just with all the we’ve been through with this I remained unsure of what the correct responses for the pages should be. Glad that’s sorted and many thanks to you and @doobox