I don't remember if I posted this before. I've got a 404.shtml that I use to handle bad/old html catalog links. Say we've renamed a product, or no longer carry it, but some index still has that page indexed.
Code:
<script language="JavaScript" type="text/javascript">
<!--
var fileName = "";
if (fileName.search("category|product")== -1) {
window.location = "http://yourcartlocation";
}
else {
fileName = fileName.replace("\.html"," ");
var keywords = fileName.split("_");
var searchterms = new Array();
if (keywords[0].search("category")>1) {
window.location = "http://yourcartlocation/customer/home.php?cat="+keywords[1];
}
else {
for (i=2; i<keywords.length-1; i++) {
searchterms.push(keywords[i]);
}
var searchstr = searchterms.join("+");
window.location = "http://yourcartlocation/customer/search.php?substring="+searchstr;
}
}
//-->
</script>
window.location = "http://www.thingsfromtheattic.com/"
Works on 3.4.x.
Walt