View Single Post
  #35  
Old 09-15-2006, 11:34 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Xuru SEO Mod --> Free SEO Mod

OK, here's my version. One known issue. Foreign characters in product names don't get converted into something usable in a URL (neither do they in the HTML catalog BTW since I borrowed the code from there). Intel352 has a fix for that and will post it later.

Unzip the attached file to include/templater/plugins/outputfilter.seo.php

In your .htaccess file add this:
Code:
RewriteEngine on RewriteBase / # Rewrite SEO category URL's RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)-p-([0-9]+)\.html$ $1home.php?cat=$2&page=$3 [L] RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)\.html$ $1home.php?cat=$2 [L] # Rewrite SEO manufacturers URL's RewriteRule ^([^/]*/)?[^/]+-m-([0-9]+)-p-([0-9]+)\.html$ $1manufacturers.php?manufacturerid=$2&page=$3 [L] RewriteRule ^([^/]*/)?[^/]+-m-([0-9]+)\.html$ $1manufacturers.php?manufacturerid=$2 [L] # Rewrite SEO product URL's RewriteRule ^([^/]*/)?[^/]+-pr-([0-9]+)\.html$ $1product.php?productid=$2 [L]

In smarty.php add this at the end just above the warning comments:
PHP Code:
############################################################
# SEO Optimization Mod
############################################################
#
# Output Filters
#
include_once($xcart_dir."/include/templater/plugins/outputfilter.seo.php");
if(
AREA_TYPE=='C' && $HTTPS != "on" && class_exists('seo_filter')) {
  
$seo = new seo_filter;
  
$smarty->register_outputfilter(array($seo,"outputfilter"));
}
# END SEO 

That's it. I have tested this on 4.0.19 and looked at versions 4.0.12 - 4.1.2 and it should work in those just fine. It really doesn't modify any existing code so it will probably work with any 4.0.x or 4.1.x version.

It is running live at http://www.snowriver.com. Performance may suck as I'm having problems with my VPS host. They keep getting someone bogging down the machine and its not me. Been going on for over a week now calling them every day. No time to be cheap moving into the holiday season so I'm moving to a dedicated server soon to avoid having problems due to other denizens of the server I'm on.
Attached Files
File Type: zip outputfilter.seo.zip (1.5 KB, 110 views)
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote