SEO forum : Search Engine Optimization Forum

SEO forum : Search Engine Optimization Forum (http://www.seo-guy.com/forum/index.php)
-   SEO Tools (http://www.seo-guy.com/forum/forumdisplay.php?f=40)
-   -   Code to build a 404 trap (http://www.seo-guy.com/forum/showthread.php?t=878)

Gas Scooter Guy 06-07-2004 08:11 PM

Code to build a 404 trap
 
I have a site I have been not paying enough attention to while building my scooter site (my wife's actually, www.alternativehealthforall.com ). It has been live for about 4 months, has not been indexed yet by google I think because there are a few (Ok, at least 6 404's in it).

Two questions:

1) How do I build a "404" trap to eliminate anger issues with Google until I can get in there and build the site properly?

2) Am I doomed since it has surely been spidered, and rejected, or can I clean it up, resubmit and have a chance that it will eventually get respidered and indexed?

It has a ton of content and my clueless meta tags from when I built it during my SEO infancy (toddler now).

Thanks,

Gas Scooter Guy

owlcroft 06-07-2004 10:30 PM

404 is your *friend*
 
What you do not want for "page not found" is the server's default 404 page.

You need to do two things: build a custom 404 page, and make sure that that page is what your visitors (and searchbots) will get if the page they're seeking isn't there.

Taking last first: you put a simple line in your .htaccess file (I presume you are using Apache and so have one, and that you know what it is and where--typically in your site's root directory).

You insert in that .htaccess file a line approximately like--
ErrorDocument 404 /myown404.shtml
I say "approximately like" because you can make its name what you want (but you need to, as that line is written, have it in your root directory). You can use, as suits your needs, an html page, an shtml page (useful if you have an "includeable" site directory), or even--and perhaps most inventive and useful--a php script.

Which last brings us to first: what the page is and does.

Naturally, you want it to look pretty and to be genteel in delivering its message, sort of "Er, um, sorry, we don't seem to have that one in stock today". But besides being genteel in explaining that there's no such page, you should do more. At the very least, direct your visitor to your site's home page. Better, if practicable, include directly or by link a Site Directory. But if you're clever and know some php, you can do ever so much more--how much is up to you. Some webmasters have the page send them an email with all the data (including the request, the visitor's info, and whatever else you like); others auto-log it somewhere.

You also may be able to use php's parsing abilities and some ingenuity to detect what page the visitor probably wanted, and redirect him or her there--that depends on your site setup and your exact pages. (If, for example, you re-ordered your directories but not your file names, it's cake.)

Note: if you use php scripts much on your site, it also behooves you to have your own 500 page, for when a script is not found.

Gas Scooter Guy 06-07-2004 10:39 PM

Eric:

I am using Frontpage with Ipower as my ISP. I will try googling "404 trap html code" and see what comes up. I understand the concept of what you are sharing, but the application is beyond my HTML skills. Is there an easier work around?

Thanks,

Gas Scooter Guy

disgust 06-07-2004 10:45 PM

I've never heard of a "404 trap" before... I can understand wanting to make a legit 404 page, but what on earth is a "404 trap"?

Arizona Web 06-12-2004 10:21 AM

a 404 trap is basically a generic document that takes what the user was looking for, whether it be by querystring, by referrer, etc and creates a page that serves them content they probably wanted... sort of. I mean nobody wants a generic page slammed with keywords and lots of affiliate links...

Some blackhat SEOs have turned this into a science and have been quite successful at it.


All times are GMT -8. The time now is 01:13 AM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.