Zen Cart Logo
Forums / All Other Contributions/Addons / Ultimate SEO v3 (and v2.200) [Support Thread]

Ultimate SEO v3 (and v2.200) [Support Thread]

Views: 427,428

Results 121 to 140 of 1,706
8 Nov 2012, 12:54 AM
#121
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Ultimate SEO v3 (and v2.200) [Support Thread]

Bizarre behavior with ultimate SEO.
Add some items to the cart but then if I go to click on the individual items again (either from the shopping cart sidebox or from the shopping cart page itself), instead of bringing me to the appropriate product page, I get redirected to:
http://spritelygoods.com/product_info
the link is clearly trying to go to the product page: http://spritelygoods.com/index.php?main_page=product_info&products_id=6:772c4cf4cfcfb000d9edc58b86b894df

Have you seen this before?
to get into the site either use the product link above or make sure to add /index.php I have a placeholder index.htm file up right now to hopefully keep people out while I do final testing.

8 Nov 2012, 1:19 AM
#122
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I've made it so you can test this on a mirror.
The please use https://www.spritelygoods.com/zencartv151 (but don't use the products linked on the front page - those all point to the root directory where the real shop lives (and that is currently down to maintenance).

If you browse/select products from the category tree or the best sellers, you can add one of them to the cart.

Thanks in advance for any guidance. I should note it works fine if I turn off Ultimate SEO URLs.

8 Nov 2012, 1:47 AM
#123
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Looks like your rewritten urls almost work. But I see somthing I've only seen once before. When I hover my cursor on a category or product link and look at the bottom of my screen, the "hover" url shows as a dynamic url; not the rewritten url. Although actually clicking on the link goes to the rewritten url in the address bar.

When I "hover" on my links at prommart com, I see the rewritten url.

So something is wrong, not sure what. Are you certain your seo admin settings match your htaccess settings?

8 Nov 2012, 1:59 AM
#124
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I;ve posted my htaccess file previously. My SEO settings on the mirror are:

Enable SEO URLs? true
Add cPath to product URLs? false
Add category parent to begining of URLs? true
Show categories as directories in the URL? true
Filter Short Words 0
Output W3C valid URLs (parameter string)? true
Enable SEO cache to save queries? true
Enable product cache? true
Enable categories cache? true
Enable manufacturers cache? true
Enable articles cache? true
Enable information cache? true
Enable automatic redirects? true
Choose URL Rewrite Type Rewrite
Enter special character conversions
Remove all non-alphanumeric characters? false
Enter PCRE filter rules for generated URLs
Reset SEO URLs Cache false
Enter pages to allow rewrite index, product_info, products_new, products_all, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4

just in case, the htaccess looks like this:

NOTE: Replace /yourdomain.com/yourzencartdirectory/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /zencartv151/

Disable if using "Categories as Directories"

#RewriteRule ^(.)-c-([0-9_]+)/(.)-p-([0-9]+).html$ $3-p-$4.html?cPath=$2&%{QUERY_STRING} [R=301,L]

Enable only if using "Categories as Directories"

RewriteRule ^(.)-c-([0-9_]+)/(.)-p-([0-9]+).html$ index.php?main_page=product_info&products_id=$4&cpath=$2&%{QUERY_STRING} [L]

Normal operation Ultimate SEO URLs

RewriteRule ^(.*)-p-([0-9]+).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]

Disable if using "Categories as Directories"

#RewriteRule ^(.)-c-([0-9_]+).html$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
#RewriteRule ^(.
)-c-([0-9_]+)/$ $1-c-$2.html [R=301,L]

Enable only if using "Categories as Directories"

RewriteRule ^(.)-c-([0-9_]+)/?.html$ $1-c-$2/ [R=301,L]
RewriteRule ^(.
)-c-([0-9_]+)$ %{REQUEST_URI}/ [R=301,L]
RewriteRule ^(.*)-c-([0-9_]+)/$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]

Normal operation Ultimate SEO URLs

RewriteRule ^(.)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+).html$ index.php?main_page=page&id=$2&%{QUERY_STRING} [L]

All other pages

Don't rewrite real files or directories

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]

Handle when a resource is not found (404 Error Page)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?main_page=page_not_found&%{QUERY_STRING} [L]

8 Nov 2012, 2:44 AM
#125
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I should mention the only difference between the mirror (which is living in a subdirectory of the main site) and the main site is the rewrite path line in the htaccess file. There is the equivalent htaccess file in the root also - both the main site and the mirror behave that way with the hover showing the dynamic url.

8 Nov 2012, 4:49 AM
#126
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

woodlandsprite:

I should mention the only difference between the mirror (which is living in a subdirectory of the main site) and the main site is the rewrite path line in the htaccess file. There is the equivalent htaccess file in the root also - both the main site and the mirror behave that way with the hover showing the dynamic url.
I've never seen that behavior before - the URLs not being generated for a page. Almost like something broke during execution. Do you happen to have any debug logs or messages in the web server logs? I did notice you do not have shopping_cart in the rewrite pages list - It should not matter, but I'll try mimicking your settings in one of my test stores tomorrow and see what happens.

I also noticed on your site Zen Cart is adding the uprid to the URL for product pages instead of the prid. I've only seen uprids used in section of the database pertaining to orders. I've never seen it added to the end of a product_info URL. If you switch back the the classic template does this still happen?

prid = 6, uprid=6:772c4cf4cfcfb000d9edc58b86b894df

8 Nov 2012, 5:09 AM
#127
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Can you also tell me which version of PHP your server is using?

I have an idea of what the problem might be (the uprid is a big hint), and your answers to this question (and the ones in my last post) should help me narrow things down.

In the meantime change this setting (product links should work again): Enable automatic redirects? false
This setting is used to issue a 301 from dynamic URLs to static URLs - and should not negatively affect any pages (shopping cart page has a noindex, nofollow for SEs).

8 Nov 2012, 5:32 AM
#128
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

Do you happen to have any debug logs or messages in the web server logs? I did notice you do not have shopping_cart in the rewrite pages list - It should not matter, but I'll try mimicking your settings in one of my test stores tomorrow and see what happens.

Looking in the logfiles I see files from today that are all very similar to each other:

PHP Fatal error: 1062:Duplicate entry 'zc_32characterstring' for key 'PRIMARY' :: insert into zen_db_cache set cache_entry_name = 'zc_32characterstring',
cache_data = 'hugecharacterstring=',
cache_entry_created = '1352311473' in /zencartdirectory/includes/classes/db/mysql/query_factory.php on line 120

As for the shopping_cart being excluded, that wasn't intentional. I left pretty much all settings for this addon as default from the install. I do not recall removing the shopping_cart page.

lhungil:

I also noticed on your site Zen Cart is adding the uprid to the URL for product pages instead of the prid. I've only seen uprids used in section of the database pertaining to orders. I've never seen it added to the end of a product_info URL. If you switch back the the classic template does this still happen?
Yes it happens both when Ultimate SEO is turned on and off and also with the default template (i've got the default template enabled right now)

Doing a file compare on the query_factory.php documents:
I notice some difference in spacing on code for certain lines, but I don't know if that is any cause for concern.

From the Ultimate SEO Install package:

if(isset($queryCache) && $queryCache->inCache($query)) {

From the original zencart install package (v1.5.1)

if( isset($queryCache) && $queryCache->inCache($query) ) {

From the Ultimate SEO Install package:

if($zf_cache AND $zc_cache->sql_cache_exists($zf_sql, $zf_cachetime)) {

From the original zencart install package (v1.5.1)

if ( $zf_cache AND $zc_cache->sql_cache_exists($zf_sql, $zf_cachetime) ) {

The "return $obj" argument is not in the same order here:

From the Ultimate SEO Install package:

if (sizeof($zp_result_array) > 0 ) {
$obj->EOF = false;
while (list($key, $value) = each($zp_result_array[0])) {
$obj->fields[$key] = $value;
}
} else {
$obj->EOF = true;
}
return $obj;

From the original zencart install package (v1.5.1)

if (sizeof($zp_result_array) > 0 ) {
$obj->EOF = false;
while (list($key, $value) = each($zp_result_array[0])) {
$obj->fields[$key] = $value;
}
return $obj;
} else {
$obj->EOF = true;
}

And lastly there is the following line that is located on different lines in the original file from the v1.5.1 install vs the document included in the Ultimate SEO package:

" $obj->is_cached = true;"

I suppose I could try to port over what I think changed on the file for the Ultimate SEO plugin (near the end of the file) while leaving the rest to match the original zencart document...

8 Nov 2012, 5:56 AM
#129
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Well I tried merging the file and of course it broke everything :P so i put it all back...

lhungil:

Can you also tell me which version of PHP your server is using?
Server is running PHP 5.3.17 (Zend: 2.3.0)

In the meantime change this setting (product links should work again): Enable automatic redirects? false
Done. But it basically has disabled the Ultimate SEO URLs. It's using all dynamic URLs while set as false.

8 Nov 2012, 2:37 PM
#130
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

woodlandsprite:

Done. But it basically has disabled the Ultimate SEO URLs. It's using all dynamic URLs while set as false.
This sounds like one of the installed files has been corrupted or might need to be re-installed. Now time to see if I can duplicate!

And yes the query_factory is different, it is from the 1.6.0 release and fixes some issues when using Zen Cart SQL caching.

8 Nov 2012, 3:06 PM
#131
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

That error message in your logs looks VERY similar to this thread: PHP Fatal Error. You might want to give the fix from that thread a try.

8 Nov 2012, 4:19 PM
#132
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

URLs not being generated
First do a "repair" of the 'zen_db_cache' table using a tool such as phpmyadmin. This table being corrupted is most likely the cause of URLs not being generated on your pages.

The table 'zen_db_cache' is only used internally to cache SQL lookups by Zen Cart. You can safely "Truncate" this table after doing the repair. Additionally, you can disable Zen Cart SQL caching (not query cache) by using the following in your configure.php files: define('SQL_CACHE_METHOD', 'none'); if desired. I do use Zen Cart SQL caching and have not yet encountered this error under 1.51 knocks on wood.

Why does this matter? "Ultimate SEO URLs" will use Zen Cart SQL caching if enabled in 'configure.php'.

Shopping Cart
I think I've found the root cause for the product page redirecting to an invalid URL. Looks like in the past the built-in php parse_url and the Zen Cart uprid did not play well together. There was still some code to handle this from pre-2.200 releases. Try the following changes and let me know if they fix the problem for you.

In seo.url.php around line 410 change

case 'products_id':
	switch(true) {
		case ($page == FILENAME_PRODUCT_REVIEWS):

to

case 'products_id':
	// Make sure if uprid is passed it is converted to the correct pid
	$p2[1] = zen_get_prid($p2[1]);
	switch(true) {
		case ($page == FILENAME_PRODUCT_REVIEWS):

And around line 1454 change

// damn zen cart attributes use illegal url characters
if ($this->is_attribute_string($this->uri)) {
	$parsed_url = parse_url($this->uri);
	$this->uri_parsed = parse_url($parsed_url['scheme']);
	$this->uri_parsed['query'] = preg_replace('/products_id=([0-9]+)/', 'products_id=$1:' . $parsed_url['path'], $this->uri_parsed['query']);
} else {
	$this->uri_parsed = parse_url($this->uri);
}

to

// damn zen cart attributes use illegal url characters
if ($this->is_attribute_string($this->uri)) {
	$parsed_url = parse_url($this->uri);
	if(array_key_exists('scheme', $parsed_url) && zen_not_null($parsed_url['scheme'])) {
		$this->uri_parsed = parse_url($parsed_url['scheme']);
	}
	else {
		$this->uri_parsed = $parsed_url;
	}
	$this->uri_parsed['query'] = preg_replace('/products_id=([0-9]+):[^&]*/', 'products_id=$1', $this->uri_parsed['query']);
} else {
	$this->uri_parsed = parse_url($this->uri);
}
8 Nov 2012, 4:55 PM
#133
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

URLs not being generated
First do a "repair" of the 'zen_db_cache' table using a tool such as phpmyadmin. This table being corrupted is most likely the cause of URLs not being generated on your pages.

Just tried this and it looks like on hover I still do not get re-written URLs, but dynamic ones. I checked my logfiles but do not see any new entries.

before tackling the code changes, I will see if changing my cache method to file helps at all.

8 Nov 2012, 5:18 PM
#134
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

woodlandsprite:

Just tried this and it looks like on hover I still do not get re-written URLs, but dynamic ones. I checked my logfiles but do not see any new entries.

before tackling the code changes, I will see if changing my cache method to file helps at all.

So....I don't know what to make of this, but if I change my cache method to "file" then the whole shopping cart thing doesn't have a problem anymore. I'm still having that bizarre business when I hover over a link, it displays the dynamic URL at the bottom of the browser, but once navigated to, the URL in the header bar is an ultimate SEO re-written URL.

in a nutshell using file-type cacheing does not put the UPRID at the end of the product link when browsing from the shopping cart.

8 Nov 2012, 5:27 PM
#135
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Would anything in the ADMINFOLDER/includes/functions/general.php contribute to this issue?
I have one other plugin that touches that file and I think I also noticed that the general.php file that is used for ultimate SEO did not match the one that came with the v151 zencart install.

I had to do a file merge to make sure I was able to still use the other plugin (Stocks by attribute)

8 Nov 2012, 5:27 PM
#136
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I still see the uprid added to the end with file caching turned on in my test environments (and on your site). From what I've read this is normal behavior for the shopping cart page.

Just because you are redirected to the URL does not mean the URLs are being re-written inside Zen Cart. I suspect something is not quite right with the installation of this module in your site. I'd especially double check the auto-loader file and the zen_href_link function changes.

I'm not sure what stock-by-attributes changes, but the changes made for this plugin to functions_general are to remove the main_page parameter and add an XSS fix. These changes on the admin side should not affect the catalog side (they are not used by the catalog side).

8 Nov 2012, 5:49 PM
#137
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

I still see the uprid added to the end with file caching turned on in my test environments (and on your site). From what I've read this is normal behavior for the shopping cart page.

:( my mistake. I had added a product without selecting an attribute...I've put it back to database caching and will go attempt your code changes now :)

As for the other, you are a genius. The function file apparently puked on the FTP or I completely missed it.

8 Nov 2012, 8:53 PM
#138
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

I have completed the edits proposed and the shop appears to be functioning properly through the shopping cart :)

Thanks so much for your help and suggestions!

9 Nov 2012, 5:33 AM
#139
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Yes, looks like your cart is now working properly. And special kudos to Ihungil for his patience and help on this support thread!

11 Nov 2012, 4:28 PM
#140
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil, First off thank you for helping me with my first issue (the PM you sent me helping me with my checkout pages)!

I have zen cart v1.5.1 and Ultimate SEO URL's, with the corresponding installation (v1.5.1). All is working fine except for one exception: it's a special characters in a category URL field.

I must not be thinking clearly. One of my clients has a category labeled as such: "CONTROL/ SHAPER". As you can see there is a forward slash here. Yeah I know it's bad to do this, but she wants it there if possible. So in my admin> config> SEO URL's I see a few fields that I think controls this:

  1. Remove all non-alphanumeric characters? is set to true
  2. Enter special character conversions. is set to: /=>-

First is this the way to convert this category issue? Second, I was confused as the the entry of #2 (above). You have this example: The formatMUST be in the form: char=>conv,char2=>conv2 which I think I am using properly. Any suggestions?