Zen Cart Logo
Forums / All Other Contributions/Addons / Simple SEO URL (OLD version) [support thread]

Simple SEO URL (OLD version) [support thread]

Views: 1,113,750

Results 4,021 to 4,040 of 5,058
16 Nov 2009, 10:24 PM
#4021
dontknowwhatimdoing avatar

dontknowwhatimdoing

Zen Follower

Join Date:
Aug 2008
Posts:
131
Plugin Contributions:
0

Simple SEO URL (OLD version) [support thread]

I figured out why my URLs were not re-written internally. It looks like I somehow missed some installation instructions. Most likely this is because the read-me with the file is dependant on external links, and somehow I didn't end up on the right link/ or didn't get the right information.

So if you are re-directing to the right page, with simple SEO url like me, but internal links were not re-written, the answer is here:
=html&s[]=output&s[]=php"]SSU Installation Instructions

  • find the function zen_href_link
    • find this line:
global $request_type, $session_started, $http_domain, $https_domain;

Insert these lines below that line:

//bof simple seo url
    global $ssu;
    if(is_object($ssu) && ($link = $ssu->ssu_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog))!= false) return $link;
//eof simple seo url

Also, make sure you edit the RIGHT html_output.php file, this one:
/includes/functions/html_output.php

Of course, don't bother changing the admin panel version of html_output.php (we don't want redirects in there).

I hope that helps anyone that had the same issue as me.

18 Nov 2009, 10:09 PM
#4022
pe1234ter avatar

pe1234ter

New Zenner

Join Date:
Mar 2009
Posts:
28
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Dear yellow

I have little problem with the Simple SEO URL

I have some products with manufacturers name contain "&" and "-"
for example "X&Y" and "X-game"
if using the manufacturer side box to sort those items, the url display like this:

For manufacturer "X&Y" will display: https://www.mydomain.com/shop/x
how to change it back to https://www.mydomain.com/shop/manufacturer/x-y

For manufacturer "X-game" will display: https://www.mydomain.com/shop/game

how to change it back to https://www.mydomain.com/shop/manufacturer/x-game

thx

19 Nov 2009, 4:01 PM
#4023
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Recently ran into a problem with Google Analytics and SSU. We did an email campaign where we wanted our links tracked. We added the conversion code but nothing was showing up on our stats.

Turns out SSU was mangling the links. The fix was easy. Go into configuration -> Simple SEO URL and add:
utm_source,utm_medium,utm_campaign,utm_content
to Set Query Key's Exclude List.

Then I reset the cache and the links weren't mangled anymore.

Just thought I'd point this out to anyone doing Google campaigns.

22 Nov 2009, 11:20 PM
#4024
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

dontknowwhatimdoing:

I figured out why my URLs were not re-written internally. It looks like I somehow missed some installation instructions. Most likely this is because the read-me with the file is dependant on external links, and somehow I didn't end up on the right link/ or didn't get the right information.

So if you are re-directing to the right page, with simple SEO url like me, but internal links were not re-written, the answer is here:
=html&s[]=output&s[]=php"]SSU Installation Instructions

global $request_type, $session_started, $http_domain, $https_domain;

> 
> 
> 
> ```
//bof simple seo url
    global $ssu;
    if(is_object($ssu) && ($link = $ssu->ssu_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog))!= false) return $link;
//eof simple seo url

Also, make sure you edit the RIGHT html_output.php file, this one:
/includes/functions/html_output.php

Of course, don't bother changing the admin panel version of html_output.php (we don't want redirects in there).

I hope that helps anyone that had the same issue as me.
I just wanted to let you know, that... I love you.

Seriously thank you for posting this. I haven't been able to figure out what was wrong for months, I guess I missed this step too :oops:

23 Nov 2009, 12:43 AM
#4025
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

I haven't been able to figure out how to work this in with the rewriting going on in the .htaccess - how do you rewrite the URL to always add the "www." to the front?

23 Nov 2009, 6:46 PM
#4026
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

bobthemolder:

I haven't been able to figure out how to work this in with the rewriting going on in the .htaccess - how do you rewrite the URL to always add the "www." to the front?
Found it: includes/configure.php

Mind you, this only changes the internal links, is there something that can be added to the .htaccess?

24 Nov 2009, 12:26 AM
#4027
psychicpet avatar

psychicpet

Inactive

Join Date:
Sep 2007
Posts:
44
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Has there been any updates to setting canonical links? I have found that since using SSU my SEO has actually dropped. I am not sure what the cause but I have a sneaking suspicion that the duplicate content is to blame.

Could the mod include a rel="canonical" link in the product page headers that always equals the SSU output?

24 Nov 2009, 12:27 AM
#4028
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,281
Plugin Contributions:
37

Re: Simple SEO URL (OLD version) [support thread]

vossom:

Hi Everyone,

Have used these forums a lot to help me learn Zen Cart and I have done 3 customized carts so far with great success. Since I have gotten so much help from the info here I wanted to share a tweak for SSU I figured out to help with the issue of having multiple URLs for the same product when that product is in multiple categories.

I would wait for Raine to verify if he thinks there are any implications of doing this, but so far it is working as I need it for me. Perhaps this can be added in the future as an option, ill detail my idea more below.

So basically almost all my products belong to two categories, so if you are browsing the 1st category with product A, you have one link, and if you are in the 2nd category with product A, you have another link, since links are formatted with the category name in them.

What I did was modify the product parser to pull back only the master category id when formulating the product URL. So no matter what category page I am on, the links to the product are using the path containing the master category id.

Location the following file:
/includes/classes/ssu/plugins/parsers/product.php and go to about line 121 to find this code:

static function getProductPath($products_id, $cPath) {
global $db;
$categories_id = self::getID($cPath, '_');

	$category_query = "select p2c.categories_id, p.master_categories_id
	                   from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
	                   where p.products_id = '" . $products_id . "'
	                   and p.products_id = p2c.products_id 
	                   and (p.master_categories_id = '$categories_id' or p2c.categories_id='$categories_id') limit 1";
	
	$category = $db->Execute($category_query);
	
	// fall back if needed to
	if ($category->RecordCount() == 0){
	 	$category_query = "select p.master_categories_id
	 						from " . TABLE_PRODUCTS . " p 
	 						where p.products_id = '" . $products_id . "' limit 1";
	 	$category = $db->Execute($category_query);
	 	if ($category->RecordCount() > 0)
	 		$categories_id = $category->fields['master_categories_id'];
	}
	
	$cPath = "";
> 
> now, comment out the first query section so that the code is forced to use the fallback code which pulls back the master category id only. the resulting code should look like the following:
> 
> ```php
static function getProductPath($products_id, $cPath) {    
		global $db;
		$categories_id = self::getID($cPath, '_');
		/*
		$category_query = "select p2c.categories_id, p.master_categories_id
		                   from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
		                   where p.products_id = '" . $products_id . "'
		                   and p.products_id = p2c.products_id 
		                   and (p.master_categories_id = '$categories_id' or p2c.categories_id='$categories_id') limit 1";
		
		$category = $db->Execute($category_query);
		*/
		// fall back if needed to
		//if ($category->RecordCount() == 0){
		 	$category_query = "select p.master_categories_id
		 						from " . TABLE_PRODUCTS . " p 
		 						where p.products_id = '" . $products_id . "' limit 1";
		 	$category = $db->Execute($category_query);
		 	if ($category->RecordCount() > 0)
		 		$categories_id = $category->fields['master_categories_id'];
		//}
		
		$cPath = "";

This is the only code change necessary. Upload the file (make sure you saved the original just in case) and then go into the SEO URL Manager in Admin under Extras and clear out the cache for the products. You may need to clear out all cache but im not sure of the overall impact, maybe Raine can comment.

So going forward, I propose to Raine to add a flag in the admin for "Use Master Category Always". When this is set to true, it will force the master category to be used in the link at all times and bypass that first part of the code like I have done here. This would be the more formal approach for your own release and would be a lot easier for you to do than me, I am sure!

Again I thank you for this mod as well as the community for all the info I have gained here!

Jason
This worked for me.

~Melanie

24 Nov 2009, 9:33 PM
#4029
pisco avatar

pisco

New Zenner

Join Date:
Nov 2009
Posts:
1
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Hello yellow,

I prepare a uppgrade for zencart, so a set up a playground with latest zencart and simple seo. So far Simple SEO works fine but the the link for the button to delte a article from shopping cart does't work if simple seo is enabled:

original link

http://example.org/index.php?main_page=shopping_cart&action=remove_product&product_id=1981:830d09ce3f787c08a88dc8e7bc52d136

but with simple seo enabled

http://example.org/shopping_cart/product_id/1981%3A830d09ce3f787c08a88dc8e7bc52d136?action=remove_product

I already played with enabled

'pages_excluded_list'   =>  explode(',', SSU_EXCLUDE_LIST),
'queries_excluded_list' =>  explode(',', SSU_QUERY_EXCLUDE_LIST)

in the config.conf and Exclude stuff at the admin interface to whitelist 'action', but i didn't got it tor work.

any hints?

BTW: I use the version from eazy templates (September 2009)

Thank you very much.

25 Nov 2009, 3:24 AM
#4030
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple SEO URL (OLD version) [support thread]

vossom:

Hi Everyone,

Have used these forums a lot to help me learn Zen Cart and I have done 3 customized carts so far with great success. Since I have gotten so much help from the info here I wanted to share a tweak for SSU I figured out to help with the issue of having multiple URLs for the same product when that product is in multiple categories.

I would wait for Raine to verify if he thinks there are any implications of doing this, but so far it is working as I need it for me. Perhaps this can be added in the future as an option, ill detail my idea more below.

So basically almost all my products belong to two categories, so if you are browsing the 1st category with product A, you have one link, and if you are in the 2nd category with product A, you have another link, since links are formatted with the category name in them.

What I did was modify the product parser to pull back only the master category id when formulating the product URL. So no matter what category page I am on, the links to the product are using the path containing the master category id.

Location the following file:
/includes/classes/ssu/plugins/parsers/product.php and go to about line 121 to find this code:

static function getProductPath($products_id, $cPath) {
global $db;
$categories_id = self::getID($cPath, '_');

    $category_query = "select p2c.categories_id, p.master_categories_id
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                       where p.products_id = '" . $products_id . "'
                       and p.products_id = p2c.products_id 
                       and (p.master_categories_id = '$categories_id' or p2c.categories_id='$categories_id') limit 1";
    
    $category = $db->Execute($category_query);
    
    // fall back if needed to
    if ($category->RecordCount() == 0){
         $category_query = "select p.master_categories_id
                             from " . TABLE_PRODUCTS . " p 
                             where p.products_id = '" . $products_id . "' limit 1";
         $category = $db->Execute($category_query);
         if ($category->RecordCount() > 0)
             $categories_id = $category->fields['master_categories_id'];
    }
    
    $cPath = "";
> 
> ```php
static function getProductPath($products_id, $cPath) {    
        global $db;
        $categories_id = self::getID($cPath, '_');
        /*
        $category_query = "select p2c.categories_id, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                           where p.products_id = '" . $products_id . "'
                           and p.products_id = p2c.products_id 
                           and (p.master_categories_id = '$categories_id' or p2c.categories_id='$categories_id') limit 1";
        
        $category = $db->Execute($category_query);
        */
        // fall back if needed to
        //if ($category->RecordCount() == 0){
             $category_query = "select p.master_categories_id
                                 from " . TABLE_PRODUCTS . " p 
                                 where p.products_id = '" . $products_id . "' limit 1";
             $category = $db->Execute($category_query);
             if ($category->RecordCount() > 0)
                 $categories_id = $category->fields['master_categories_id'];
        //}
        
        $cPath = "";
```This is the only code change necessary. Upload the file (make sure you saved the original just in case) and then go into the SEO URL Manager in Admin under Extras and clear out the cache for the products. You may need to clear out all cache but im not sure of the overall impact, maybe Raine can comment.
> 
> So going forward, I propose to Raine to add a flag in the admin for "Use Master Category Always". When this is set to true, it will force the master category to be used in the link at all times and bypass that first part of the code like I have done here. This would be the more formal approach for your own release and would be a lot easier for you to do than me, I am sure! 
> 
> Again I thank you for this mod as well as the community for all the info I have gained here!
> 
> Jason

Hi Jason I just wanted to say thank you for this fix. I was having trouble with this too, and this seems to work quite nicely. Maybe yellow can includes it in admin. Thanks again.
25 Nov 2009, 3:36 AM
#4031
xwq19870217 avatar

xwq19870217

New Zenner

Join Date:
Nov 2009
Posts:
1
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

lol very useful 。 thank you share with us 。 best regards

25 Nov 2009, 6:58 PM
#4032
davx avatar

davx

New Zenner

Join Date:
Nov 2009
Posts:
80
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

I don't know if you will be able to help but I have installed simple seo - and it works fine on all pages, except if you try to log in with a session (zenid) attached to the url it trys to log in but come back page not redirecting properly.

If you log in with the url just login.html it works fine.

Also if you turn off simple seo, it works fine with the zenid.

Any ideas?

25 Nov 2009, 9:44 PM
#4033
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Hi, I need help with editing code for my products xml feed. I have alreday posted sm simillar post to this long time ago but it is still unanswered. There is function I made to get URL:

  function zen_seo_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true) {
    global $request_type, $session_started, $http_domain, $https_domain;
    global $ssu;
    if(is_object($ssu) && ($link = $ssu->ssu_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog))!= false) return $link;
    }

and its for link itself:

$link = zen_seo_href_link(zen_get_info_page($products->fields['products_id']), 'products_id=' . $products->fields['products_id'], 'NONSSL', false);

I am not very familiar with PHP and this cause that url is blank. I will be very happy for every assist. There is code which works with Ultimate Seo URLs:

function zen_seo_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true) {
if (defined('SEO_ENABLED') && SEO_ENABLED == 'true') {
if (!isset($GLOBALS['seo_urls']) && !is_object($GLOBALS['seo_urls'])) {
include_once('../' . DIR_WS_CLASSES . 'seo.url.php');
$GLOBALS['seo_urls'] = &new SEO_URL($_SESSION['languages_id']);
}
return $GLOBALS['seo_urls']->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
} else {
return zen_href_link($page, $parameters, $connection, $add_session_id);
}
}
26 Nov 2009, 5:40 PM
#4034
vicavendano avatar

vicavendano

New Zenner

Join Date:
Oct 2009
Location:
Bronx, NY
Posts:
22
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

yellow1912:

What you can do, is to try replacing all & by & using str_replace at the end of the function ssu_link in that same file, something like this
$link = str_replace('&', '&', $link);

Do it right before
return $link;

Just a note, I have not checked it yet, so use t your own risk. I will look into this issue more carefully in the next version.

Hi, I have been working to get my pages validated, I browsed through the forums and found this solution to fix the unescaped ampersand issue in urls. I applied the change above, and the pages validate now. However when I go to a page that has parameters in the url (such as filter_id) it writes the escaped version of the ampersand in the address bar of the browser. (https://www.site.com/category/?sort=20a&filter_id=34). The pages still work fine and validate, but I would like the escaped version to be in the links within the html, not in the browser url bar. Any help would be greatly appreciated!

zen cart: 1.3.8.a
ssu: 3.7.1

28 Nov 2009, 1:00 PM
#4035
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

neboztik:

Hi, I need help with editing code for my products xml feed. I have alreday posted sm simillar post to this long time ago but it is still unanswered. There is function I made to get URL:

function zen_seo_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true) {
global $request_type, $session_started, $http_domain, $https_domain;
global $ssu;
if(is_object($ssu) && ($link = $ssu->ssu_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog))!= false) return $link;
}

> ```php
$link = zen_seo_href_link(zen_get_info_page($products->fields['products_id']), 'products_id=' . $products->fields['products_id'], 'NONSSL', false);
```I am not very familiar with PHP and this cause that url is blank. I will be very happy for every assist. There is code which works with Ultimate Seo URLs:
> ```php
function zen_seo_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true) {
if (defined('SEO_ENABLED') && SEO_ENABLED == 'true') {
if (!isset($GLOBALS['seo_urls']) && !is_object($GLOBALS['seo_urls'])) {
include_once('../' . DIR_WS_CLASSES . 'seo.url.php');
$GLOBALS['seo_urls'] = &new SEO_URL($_SESSION['languages_id']);
}
return $GLOBALS['seo_urls']->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
} else {
return zen_href_link($page, $parameters, $connection, $add_session_id);
}
}

Not sure why you post Ultimate SEO URL code here?

Also, xml feeder should use the catalog's zen_href_link function not the admin's one. Most xml feeders written that way work with SSU right out of the box without any modification needed.

28 Nov 2009, 1:05 PM
#4036
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Davx:

I don't know if you will be able to help but I have installed simple seo - and it works fine on all pages, except if you try to log in with a session (zenid) attached to the url it trys to log in but come back page not redirecting properly.

If you log in with the url just login.html it works fine.

Also if you turn off simple seo, it works fine with the zenid.

Any ideas?
First, you should try to turn off, not using extension

Second, you should check if you get the latest stable version, where did you get your package?

28 Nov 2009, 4:25 PM
#4038
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

yellow1912:

Not sure why you post Ultimate SEO URL code here?

Also, xml feeder should use the catalog's zen_href_link function not the admin's one. Most xml feeders written that way work with SSU right out of the box without any modification needed.
Not for mine, it is generating default zencart url instead of seo urls. It is not very sofisticated feed generator (only one file). I posted code of function which works fine with Ultimate SEO URLs but for SSU you need another function with SSU parametrs which I actualy dont know.

28 Nov 2009, 5:56 PM
#4039
twdhosting avatar

twdhosting

Zen Follower

Join Date:
Mar 2005
Posts:
119
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

I'm having MAJOR headaches with SSU and Google Checkout...

Basically when a sale is made via Google Checkout the Google API calls back to /googlecheckout/responsehandler.php but having done some testing it seems that all calls to this file are getting a 404 (not found) error from my server.

Going directly to https://www.mysite.com/googlecheckout/responsehandler.php goes to the 404 sitemap page, when I turn off SSU it works fine?????

The page is supposed to throw up a username / password box using .htaccess password protection but its just a 404???

Originally the file rewrote as responsehandler_php but I seem to have fixed that issue by using an ignore rule in the root .htaccess file

28 Nov 2009, 7:48 PM
#4040
twdhosting avatar

twdhosting

Zen Follower

Join Date:
Mar 2005
Posts:
119
Plugin Contributions:
0

Re: Simple SEO URL (OLD version) [support thread]

Okay after doing a bit of Googling it seems that there is a problem with using password protected directories and having mod_rewrite rules in the root .htaccess file - which is why (I presume) that when SSU is turned off the root .htaccess isn't used and password authentication works?

Any .htaccess guru's know how I can get a password protected directory to work with the SSU .htaccess file?