X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   404 page for handling bad HTML catalog pages (https://forum.x-cart.com/showthread.php?t=12284)

walteis 02-19-2005 03:45 PM

404 page for handling bad HTML catalog pages
 
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

DogByteMan 02-19-2005 04:17 PM

substring does not pass in 4.0.X. For a sec i thought I had it.... I'll work on it. If anyone knows how to pass the keywords in 4.0.X, let us know

DogByteMan 02-19-2005 07:35 PM

This is nothing short of a total bummer...

Finally find a way to have a search404 and because I upgraded 4.0.X I can't use it.

Anybody know how we can pass the variable in 4.0.X?

Lingerieblowout 02-20-2005 09:35 AM

Didn't work in 3.4.7
 
I tried this on 3.4.7 for an item I know I removed and went to google found it and when I click on it in goggle it went to the home page with search string http://www.lingerieblowout.com/customer/search.php?substring= any idea


Michael

walteis 02-20-2005 01:07 PM

You need to make sure that you or your hosting company has Server Side Includes (SSI) turned on. Your 404.shtml will need to be executable as well IIRC.

Lingerieblowout 02-21-2005 09:50 AM

SSI are turned on and the 404 page is set to executable. Its probably because my home page is set to redirect. to /customer

DogByteMan 02-22-2005 05:27 PM

How difficult would it be to change the POST method search in 4.0.x to the GET method found in 3.x.x, so that you could use substring=???

DogByteMan 02-23-2005 06:13 PM

OK let's try the question this way... How difficult would it be to implement the 3.x.x branch search into 4.0.x Version X-Carts so that substring=??? could be used for the 404search and for the ability to link searches.

DogByteMan 02-24-2005 09:37 AM

How can one tell when they have reached the limits of the X-Cart Forum???

Nobody answers your posts any longer :cry:

walteis 02-25-2005 08:56 AM

We're just converting to the 4.x branch, so I'll be rewriting this soon. I'll post a new version once that's done.

Walt


All times are GMT -8. The time now is 09:04 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.