Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

404 page for handling bad HTML catalog pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-19-2005, 03:45 PM
 
walteis walteis is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: USA
Posts: 65
 

Default 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
__________________
X-cart Gold 4.1.7 on Linux/Apache.
Reply With Quote
  #2  
Old 02-19-2005, 04:17 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

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
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #3  
Old 02-19-2005, 07:35 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

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?
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #4  
Old 02-20-2005, 09:35 AM
 
Lingerieblowout Lingerieblowout is offline
 

X-Adept
  
Join Date: Sep 2003
Location: Annapolis, MD
Posts: 415
 

Default 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
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #5  
Old 02-20-2005, 01:07 PM
 
walteis walteis is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: USA
Posts: 65
 

Default

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.
__________________
X-cart Gold 4.1.7 on Linux/Apache.
Reply With Quote
  #6  
Old 02-21-2005, 09:50 AM
 
Lingerieblowout Lingerieblowout is offline
 

X-Adept
  
Join Date: Sep 2003
Location: Annapolis, MD
Posts: 415
 

Default

SSI are turned on and the 404 page is set to executable. Its probably because my home page is set to redirect. to /customer
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #7  
Old 02-22-2005, 05:27 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

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=???
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #8  
Old 02-23-2005, 06:13 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

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.
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #9  
Old 02-24-2005, 09:37 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

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

Nobody answers your posts any longer
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #10  
Old 02-25-2005, 08:56 AM
 
walteis walteis is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: USA
Posts: 65
 

Default

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
__________________
X-cart Gold 4.1.7 on Linux/Apache.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:17 PM.

   

 
X-Cart forums © 2001-2020