Hi my name is christian and i am a webmaster. first create a file and name it .htaccess then put this code inside it:
ErrorDocument 404 /404.html
next you will need to create a file and name it 404.html you will then embed this redirect code in it.
location.href = 'http://www.yourwebsitename.com';
Basically you have told the server that any bad links should just goto the 404.html page. then the 404.html page will then redirect them to the home page. essentially this is a double redirect and the reasoning is that if you redirect straight to the home page the client will still see the bad url in the address bar and this method cleanses the bar more or less
you can view it here on my site just goto http://www.hotrockhosting.com/whatev...t-to-type-here
and you will see that eventualy you will be redirected to the home page.... hope this helps cuz it was a pain in my a$$ to figure out hahahahahha lol
ps upload the 404.html and the .htaccess file into your website root (public_html) folder. also not sure if will work with site builders like yahoo and godaddy, but it works for raw websites. any questions email me webdesignerchristianatgmaildotcom