Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

I noticed the same thing. What I did was go to the SEO URLS ADMIN and reset the cache. This fixes the problem from what I can see. HOWEVER, now my Products URL's are back to the old way. I uninstalled the articles manager SEO and then reinstalled it again and everything works fine. HOWEVER, once I add a product or new article the URL's are the old way on the new ones added. If I reset the cache it fixes the articles URL but once again it puts ALL the products back to the old urls again and back I go again to the uninstall and reinstall of the Articles SEO. Works great as long as you don't add anything. Looks like these two modules are clashing with one another. BOBBY, we need your help!

 

 

I must say I am not familiar with articles - but one thing you all need to realize is the SEO URLs run off a cache conversion. So any time you add a URL that uses a SEO URL you will have to reset the cache.

 

So in the cataegories you will need call the reset and if you modify the manufactures you will again and same for articles too.....

 

 

Because they all are different I can't give you examples to all on a public forum...

 

But you need to look for actions that will affect the URL (like adding new cats or articles or products)...

 

If it does you need code to reset the cache something like this:

 

 

// If the action will affect the cache entries
if ( eregi("(insert|update|setflag)", $HTTP_GET_VARS['action']) ) include_once('includes/reset_seo_cache.php');

 

if you can not figure out how to apply that where you need to you can alos do this...

After you see a function like add or update there is a redirect most all of the time after it updates the database so you could add the reset before the redirect.

 

 
include_once('includes/reset_seo_cache.php');
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));

 

 

Hope this helps a little.

 

Chris

 

Here is a snippet for stock OSC categories example (around line 20 of admin/categories.php):

 

if (tep_not_null($action)) {
 # Reset Cach on these functions
 if (eregi("(insert|update|setflag)", $HTTP_GET_VARS['action']))
 include_once('includes/reset_seo_cache.php');
 # eof reset ------------------|
   switch ($action) {
     case 'setflag':
       if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
         if (isset($HTTP_GET_VARS['pID'])) {
           tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
         }

         if (USE_CACHE == 'true') {
           tep_reset_cache_block('categories');
           tep_reset_cache_block('also_purchased');
         }
       }

Edited by clarocque

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

Something is strange with your installations. You should not even ever really have to manually reset the cache. Ive installed the mod, and it works as intended. After adding a new category or product, the cache instantly updates itself. Was it working like this before the articles modification?

 

And, can someone answer my last post - it's driving me crazy..

Link to comment
Share on other sites

Something is strange with your installations. You should not even ever really have to manually reset the cache. Ive installed the mod, and it works as intended. After adding a new category or product, the cache instantly updates itself. Was it working like this before the articles modification?

 

And, can someone answer my last post - it's driving me crazy..

 

 

yes and no...

 

 

step 6 is the code for the categories reset... but if you are using articles you will need to add the reset code for that...

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

How can i do a PermanentRedirect for one of the ultimate SEO urls. When i do the command, and then click on the old link in google, the new page comes up, but with additional product and category numbers appended on the end of the url..

 

Suggestions, chemo?

 

 

Give me some examples so I know wexactly what you mean...

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Since installing the contrib to allow group discount pricing I suddenly found the person who coded it DID NOT understand tep_href_link! I have just looked and you're right - those links do not use it, I will change and see what happens...

Link to comment
Share on other sites

Hmm... I have amended the links to tep_href_link but I have got a problem where all items in the left box are coming up as "view complete price list" only - see http://ftpupload.bpweb.net/catalog/index.php?cPath=41

 

The only lines of code I have changed are the 3 that were using A HREF and are now using tep_href_link as below. Any ideas anyone please?

 

 

if ($ifsearch == "search" && $from == "0" && $categories_id != "57" && $categories_id != "21" && $categories_id != "65" && $categories_id != "59" )

{

?>

<tr><td style="padding-left: 12px;" <? if ($categorylist == $cPath) {?> bgcolor="#dcdcdc"<? } ?>>

<?php echo '<a href="' . tep_href_link('/catalog/advanced_search_result.php?keywords=&categories_id=21&inc_subcat=1&manufacturers_id=&pfrom=$from&pto=$to&dfrom=&dto=&x=0&y=0&cPath=$categories_id') . '">Cars up to ?$to</a> </td></tr>' ?>

<? }

 

if ($ifsearch == "search" && $from != "0" && $categories_id != "57" && $categories_id != "21" && $categories_id != "65" && $categories_id != "59" )

{

?>

<tr><td style="padding-left: 12px;" <? if ($categorylist == $cPath) {?> bgcolor="#dcdcdc"<? } ?>>

<?php echo '<a href="' . tep_href_link('/catalog/advanced_search_result.php?keywords=&categories_id=21&inc_subcat=1&manufacturers_id=&pfrom=$from&pto=$to&dfrom=&dto=&x=0&y=0&cPath=$categories_id') . '">Cars between ?$from and ?$to</a> </td></tr>' ?>

<? }

 

if ($ifsearch != "search" && $categories_id != "57" && $categories_id != "21" && $categories_id != "65" && $categories_id != "59" )

{

?>

<tr><td style="padding-left: 12px;" <? if ($categorylist == $cPath) {?> bgcolor="#dcdcdc"<? } ?>>

 

<?php echo '<a href="' . tep_href_link('products_all.php') . '">View Complete Price List</a>' ?>

<? }

++$ilist;

}

 

?>

Link to comment
Share on other sites

Example of redirect problem when using Ultimate SEO URLS.

 

When doing an htaccess redirect,

 

RedirectPermanent /myfile.html http://www.mysite.com/newfile.html

 

and then clicking on the old link in google, yahoo, any site, etc.

 

the site will redirect to the correct page, but as this url

 

http://www.mysite.com/newfile.html?cPath=2...&products_id=86

 

with the cPath and product id appended on the end of the url. I dont want this to get indexed as the new page. I have just been dropping the page, then waiting for the new page to get indexed, but this is terrible for transfering page rank.

 

Any ideas?

Link to comment
Share on other sites

Good contribution. I wanted to find out how to get rid of the bit -p-24 that follows the product name in the url?

 

This is the way it looks now = bosch-condenser-7379-p-24.html

 

I want it to look like this = bosch-condenser-7379.html

 

Not just for this url, it's only an example. I want all my urls with out the little bit after the product name.

 

also wanted to find out how to add the model number to the url after the product name?

 

Thanks,

Mike

Edited by bugauto
Link to comment
Share on other sites

That's not a bug but rather it is a feature.

 

The default behavior of the code is to turn itself off at the first sign of trouble.  If it cannot turn it into a clean SEO URL it outputs the default function return.  In the case of attributes it turns itself off...the SEO equivalent is not defined.  Hence, you get the stock URL instead.

 

I don't consider this a problem.  The only ones that will see it are the customers and that is only for 1 click.  Once they return to a page with all SEO links they won't even notice.  The search engine spiders shouldn't get that far to begin with (you do have shopping_cart.php in your robots.txt file, right?) so no worries there.

 

Bobby

 

Hi, I'm currently looking at installing Ultimate SEO, and just reading throught the forum before I get under way, The site I have developed to start with is small, 10 products and all of them have attributes! Does this mean I'm as well not to install U SEO for just now, maybe a site map would be better, any thoughts anyone :blush:

Link to comment
Share on other sites

Example of redirect problem when using Ultimate SEO URLS.

...

with the cPath and product id appended on the end of the url. I dont want this to get indexed as the new page. I have just been dropping the page, then waiting for the new page to get indexed, but this is terrible for transfering page rank.

 

Any ideas?

Jon,

 

The redirect code only redirects those URLs that are products_info or index...the rest are allowed to request. I don't know why it would also redirect a natural HTML page since there are switches to turn it off if the requested file is NOT a PHP (or a category/product page).

 

Good contribution. I wanted to find out how to get rid of the bit -p-24 that follows the product name in the url?

 

This is the way it looks now = bosch-condenser-7379-p-24.html

 

I want it to look like this = bosch-condenser-7379.html

 

Not just for this url, it's only an example. I want all my urls with out the little bit after the product name.

 

also wanted to find out how to add the model number to the url after the product name?

 

Thanks,

Mike

Trust me...just leave it the way it is :)

 

Hi, I'm currently looking at installing Ultimate SEO, and just reading throught the forum before I get under way, The site I have developed to start with is small, 10 products and all of them have attributes!  Does this mean I'm as well not to install U SEO for just now, maybe a site map would be better, any thoughts anyone :blush:

IMO, it's best to start with SEO URLs even if you only have 4 products. The increased search engine rankings are worth its weight in platinum!

 

Bobby

Link to comment
Share on other sites

Hi Bobby,

 

Forgive me if this is mentioned elsewhere, but I've forum searched, Google seached, and skimmed over the past 44 pages!

 

I've installed your SEO contrib (which is great) but I have a few issues.

 

1) - The Key issue - When I have force cookie usage disabled (so that non cookied browsers can purchase) I have an SID on the url. This is fine.

When I get to the product page, and click add to basket, my URL has 2 SID's appended (both with ? - rather than ? and &). This breaks the basket and I end up with no products.

This also happens on some of the links through the site, and if I keep clicking products, etc, then I can build a URL of 5 - 10 OSCsids!

 

2) My category list isn't being re-written. It's just a url with a c-path.

Any ideas?

 

What do I need to post for you (or anyone else) to help me debug this?

 

Many thanks in advance for your help!

 

Craig

Link to comment
Share on other sites

Phew, was making some silly mistakes there but installed now B)

 

With the site having friendly urls, do I need to install the "Spider Session Remover" or something similar sid killer etc?

 

or effectivly the spiders will never see a sid now is that a case, some of my naivety still shining through, come a long way though over the past couple of months :-)

Link to comment
Share on other sites

Thank you for time in writting this contribution. I have a little problem in getting it to work. After I did the install the admin area is functions but the store now will not display and I have this error

1146 - Table 'polyb2_osc1.cache' doesn't exist

 

DELETE FROM cache WHERE cache_expires <= '2005-04-05 07:11:42'

 

[TEP STOP]

 

my url can be found here My Webpage

Please let me know what more information that you need from me. Thank you for your time

Link to comment
Share on other sites

ok i have got it installed but now i have erros at the bottom of the page, some of the products will not show and the urls have not changed. I went into the admin area enabled everything and rest the reset the cache data. So i am a little stumped right now. I will keep working on it and hopefully i will find the problem.

Link to comment
Share on other sites

Hi Bobby,

 

Forgive me if this is mentioned elsewhere, but I've forum searched, Google seached, and skimmed over the past 44 pages!

 

I've installed your SEO contrib (which is great) but I have a few issues.

 

1) - The Key issue - When I have force cookie usage disabled (so that non cookied browsers can purchase) I have an SID on the url. This is fine.

When I get to the product page, and click add to basket, my URL has 2 SID's appended (both with ? - rather than ? and &). This breaks the basket and I end up with no products.

This also happens on some of the links through the site, and if I keep clicking products, etc, then I can build a URL of 5 - 10 OSCsids!

 

2) My category list isn't being re-written. It's just a url with a c-path.

Any ideas?

 

What do I need to post for you (or anyone else) to help me debug this?

 

Many thanks in advance for your help!

 

Craig

1. Fix your configure.php file -> specifically the cookie domains. Have you changed the sessionID to something other than the stock osCsid?

2. Clear your category box cache.

 

Phew, was making some silly mistakes there but installed now  B)

 

With the site having friendly urls, do I need to install the "Spider Session Remover" or something similar sid killer etc?

 

or effectivly the spiders will never see a sid now is that a case, some of my naivety still shining through, come a long way though over the past couple of months :-)

Update your spiders.txt file and enable the prevent spider sessions feature via admin control panel.

 

ok i have got it installed but now i have erros at the bottom of the page, some of the products will not show and the urls have not changed. I went into the admin area enabled everything and rest the reset the cache data. So i am a little stumped right now. I will keep working on it and hopefully i will find the problem.

You have an error in the cut-n-pasting of the code. Review the code modifications to tep_href_link() and also the products_listing module.

 

Bobby

Link to comment
Share on other sites

appreciate the reply, but not sure i follow.

 

How should i do a redirect, for a product or category, if the name of the page changes? If you follow my example, you can see how the category/product number is appended to the end when trying...?

Link to comment
Share on other sites

1. Fix your configure.php file -> specifically the cookie domains.  Have you changed the sessionID to something other than the stock osCsid?

2. Clear your category box cache.

Update your spiders.txt file and enable the prevent spider sessions feature via admin control panel.

You have an error in the cut-n-pasting of the code.  Review the code modifications to tep_href_link() and also the products_listing module.

 

Bobby

 

My stupid mistake, I have been working on this now for 2 days with only 3 hours sleep. Thanks for the help

Link to comment
Share on other sites

Hi,

 

I've been reading all post for 2 days in the hope that I would find my problem.

 

My seo urls are working, and the things get rewriten per categorie and sub categorie, only it is not rewriting per product. Than it looks like this:

 

http://jewelry-trends.com/product_info.php?products_id=55

 

Until know I didn't think it would create any problems, but what the heck do I know :D , because I also installed the froogle feed contrib from Chemo, and everything goes alright also, except......it doesn't link back correctly to the product.

 

So the circle is closed, I have to fix problem a to not have problem b.

Link to comment
Share on other sites

Hi,

 

I've been reading all post  for 2 days in the hope that I would find my problem.

 

My seo urls are working, and the things get rewriten per categorie and sub categorie, only it is not rewriting per product. Than it looks like this:

 

http://jewelry-trends.com/product_info.php?products_id=55

 

Until know I didn't think it would create any problems, but what the heck do I know :D , because I also installed the froogle feed contrib from Chemo, and everything goes alright also, except......it doesn't link back correctly to the product.

 

So the circle is closed, I have to fix problem a to not have problem b.

Solved it, can you believe, looked all over the place for a solution., and the moment I gave up, it came to me.AS ALWAYS :D

Link to comment
Share on other sites

1. Fix your configure.php file -> specifically the cookie domains. Have you changed the sessionID to something other than the stock osCsid?

2. Clear your category box cache.

 

Hi Bobby,

 

Done (2) and that worked a treat, thank you.

As far as (1) goes, I'm not sure if you fully understood me, I don't want to change the cookie domain (which is correct) as I am having this issue when 'Force Cookies' is disabled.

More specifically - If I disable 'Force Cookie Usage', then disable session cookies in my browser (and clear the cookie cache) I can browse the site, and the links have oscSid's on them.

When I add a product to the basket, or buy it now, I get redirected back the the product page but then the link looks like this:

xxx.com/shop/rocky-combo-p-767.html?osCsid=da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc

And I have nothing in my basket (I'm guessing the basket code has a fit with the malformed duplicate SID's)

 

At the bottom of the page I get this SQL error:

1062 - Duplicate entry 'da898eb7ed080dd52ba7383f6f38accc' for key 1

 

insert into sessions values ('da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc', '1112735942', 'cart|O:12:\"shoppingcart\":4:{s:8:\"contents\";a:0:{}s:5:\"total\";i:0;s:6:\"weight\";i:0;s:12:\"content_type\";b:0;}language|s:7:\"english\";languages_id|s:1:\"1\";currency|s:3:\"GBP\";navigation|O:17:\"navigationhistory\":2:{s:4:\"path\";a:1:{i:0;a:4:{s:4:\"page\";s:16:\"product_info.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:2:{s:11:\"products_id\";s:3:\"767\";s:6:\"osCsid\";s:72:\"da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc\";}s:4:\"post\";a:0:{}}}s:8:\"snapshot\";a:0:{}}')

 

Thanks,

 

Craig

Link to comment
Share on other sites

Bobby,

 

To give more info, the pages i am trying to redirect are the product_info or category pages, like

 

http://www.mysite.com/mycategory-c-60.html

 

http://www.mysite.com/myproduct-p-576.html

 

If a product changes name, for example, how can i redirect the old url to the new one?

Using .htaccess PermanentRedirect, will direct to the proper page when clicking on the old link in google, yahoo, etc., but the url is formed like so:

 

http://www.mysite.com/my-new-product-p-576...products_id=576

 

appending an extra id on the end of the url. I dont want to have the new link spidered this way. You can test redirecting a page, to see what i mean.

 

Any ideas?

Link to comment
Share on other sites

Hi Bobby,

 

Done (2) and that worked a treat, thank you.

As far as (1) goes, I'm not sure if you fully understood me, I don't want to change the cookie domain (which is correct) as I am having this issue when 'Force Cookies' is disabled.

More specifically - If I disable 'Force Cookie Usage', then disable session cookies in my browser (and clear the cookie cache) I can browse the site, and the links have oscSid's on them.

When I add a product to the basket, or buy it now, I get redirected back the the product page but then the link looks like this:

xxx.com/shop/rocky-combo-p-767.html?osCsid=da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc

And I have nothing in my basket (I'm guessing the basket code has a fit with the malformed duplicate SID's)

 

At the bottom of the page I get this SQL error:

1062 - Duplicate entry 'da898eb7ed080dd52ba7383f6f38accc' for key 1

 

insert into sessions values ('da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc', '1112735942', 'cart|O:12:\"shoppingcart\":4:{s:8:\"contents\";a:0:{}s:5:\"total\";i:0;s:6:\"weight\";i:0;s:12:\"content_type\";b:0;}language|s:7:\"english\";languages_id|s:1:\"1\";currency|s:3:\"GBP\";navigation|O:17:\"navigationhistory\":2:{s:4:\"path\";a:1:{i:0;a:4:{s:4:\"page\";s:16:\"product_info.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:2:{s:11:\"products_id\";s:3:\"767\";s:6:\"osCsid\";s:72:\"da898eb7ed080dd52ba7383f6f38accc?osCsid=da898eb7ed080dd52ba7383f6f38accc\";}s:4:\"post\";a:0:{}}}s:8:\"snapshot\";a:0:{}}')

 

Thanks,

 

Craig

 

My bet is the your cookie is not correct that is why have this problem. Post or IM me your cookie setting from configuration.

 

Chris

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Trying to upgrade to 2.0 from 1.4,

 

when I try to run install-seo.php I am getting this error:

 

Fatal error: Call to a member function on a non-object in /usr/local/www/vhosts/mydomain.com/htdocs/includes/seo_cache.php on line 47

 

The error is on the whole site, so it's not an install-seo.php error. But does anyone know how to fix it?

Edited by WebPixie
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...