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)
-   -   Xuru SEO Mod --> Free SEO Mod (https://forum.x-cart.com/showthread.php?t=24832)

Jayk 09-14-2006 02:23 PM

Re: Xuru SEO Mod --> Free SEO Mod
 
Is anyone running this mod on a 4.1.x production site? I'd like to see it in action before I give it a whirl.

Thanks,
Jason

JeremyL 09-14-2006 02:49 PM

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

Originally Posted by Jayk
In the install docs, under files that need to be edited, you show:

/smarty.php
/auth.php
/smarty.php

I think the first one is supposed to be config.php. :wink:

Cheers,
Jason


Fixed. Thanks

JeremyL 09-14-2006 02:51 PM

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

Originally Posted by Jayk
Is anyone running this mod on a 4.1.x production site? I'd like to see it in action before I give it a whirl.

Thanks,
Jason


I've got it on a private url. I'll install a test copy on a public url tonight and post it.

intel352 09-14-2006 05:02 PM

Re: Xuru SEO Mod --> Free SEO Mod
 
I personally do not recommend the mod for production use currently. If anything, please wait until geckoday uploads his modified files, they have been in use on a production site with few issues for awhile now.

Additionally, if I remember correctly, when I installed mod on x-cart 4.1, I believe I did have to modify auth.php at one point. I don't remember exactly tho. The entry point for the mod in 4.1 was different than in 4.0

I'll check the docs tomorrow, don't have long on a net connection tonight

geckoday 09-15-2006 11:34 AM

Re: Xuru SEO Mod --> Free SEO Mod
 
1 Attachment(s)
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.

intel352 09-15-2006 11:46 AM

Re: Xuru SEO Mod --> Free SEO Mod
 
I'm working with geckoday's code at the moment, it's nicely done. Testing on X-Cart 4.1.2 shows that the mod works well.

I'm making a few modifications so that Accented characters will translate properly, and I'm also working on code to redirect the old home|product|manufacturers.php urls to the new .html url, to help prevent duplicate content.

I'll create a code branch in the SVN repository and upload my changes there, as well as creating an archive for you guys to download directly ;-)

Jon 09-15-2006 12:17 PM

Re: Xuru SEO Mod --> Free SEO Mod
 
Just a note, you'll also want to rewrite the sort links on the category pages, the printable urls, and the js=n/y links or block them in an .htaccess file to prevent duplicate content.

geckoday 09-15-2006 09:53 PM

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

Originally Posted by Jon
Just a note, you'll also want to rewrite the sort links on the category pages, the printable urls, and the js=n/y links or block them in an .htaccess file to prevent duplicate content.

Those items would also cause duplicate content in base X-Cart. My mod is a step up but not the holy grail which is exactly what was intended. As I said earlier, it works pretty much just like DSEFU which doesn't do those things and there seems to be a lot of people happy with its ability to increase rankings.

geckoday 09-16-2006 06:57 AM

Re: Xuru SEO Mod --> Free SEO Mod
 
Ooops. I forgot to post the changes to the Froogle module. These froogle changes apply to 4.0.19 and 4.1.x. You can probably figure out the equivalent change for earlier releases but I don't believe they work with the new google base anyway. At the top of froogle.php right after this:
PHP Code:

if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); } 


Add this:
PHP Code:

$seo = new seo_filter


Then find this:
PHP Code:

$post substr(str_replace(array("\t","\r","\n"), array(" ","",""), $product['product']), 080)."\t".
                
$product['descr']."\t".
                
$http_location.constant("DIR_CUSTOMER")."/".$prod_url."\t"

And replace it with this:
PHP Code:

# Build SEO URL
      
$prod_url $seo->_product_filename($product['productid'], $product['product']);

            
# Post string
            
$post substr(str_replace(array("\t","\r","\n"), array(" ","",""), $product['product']), 080)."\t".
                
$product['descr']."\t".
                
$http_location.constant("DIR_CUSTOMER")."/".$prod_url."\t"


NOTE: Edited Saturday 9/16 at about 2:40 PM PDT to remove unneccessary include_once, added note on releases and fixed the find/replace for the product URL (I was wolfing down breakfast rushing to get out the door to open my B&M store and botched it horribly). Just goes to show you there are good reasons to pay for DSEFU or CDSEO - you get someone who has packaged it for human consumption already and will install it and make sure it works on your box.

B00MER 09-16-2006 11:32 AM

Re: Xuru SEO Mod --> Free SEO Mod
 
Shouldn't Smarty auto-magically include/require anything within its plugin subdir?

:arrow: http://smarty.php.net/manual/en/plugins.php :?:

Making this line, not needed?
PHP Code:

include_once $xcart_dir."/include/templater/plugins/outputfilter.seo.php"



All times are GMT -8. The time now is 06:16 PM.

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