Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

Hi Bobby

Can you please tell me which sitemap contribution you are referring to. There are many available and I want to install the best one for SEO purposes.

 

Thanks

Elizabeth

 

OK...finally figured out why second level URLs from the sitemap contribution and others were not be SEO'd:

 

Their code is passing the category_id to the tep_href_link() function and NOT the full cPath as is required.  To correct this use a DERIVATIVE of this code which finds the full cPath:

$c = array();
# Get the category path
    tep_get_parent_categories($c, $record['id']);
# For some reason it seems to return in reverse order so reverse the array
    $c = array_reverse($c);
# Implode the array to get the full category path
    $id = (implode('_', $c) ? implode('_', $c) . '_' . $record['id'] : $record['id']);

You'll need to modify some of the variables ($record['id'] for example) but shouldn't be too hard to figure out.

 

The take home lesson is that the FULL cPATH should be passed to the tep_href_link() function and not just the category_id.

 

Bobby

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

$c = array();
# Get the category path
? ? tep_get_parent_categories($c, $record['id']);
# For some reason it seems to return in reverse order so reverse the array
? ? $c = array_reverse($c);
# Implode the array to get the full category path
? ? $id = (implode('_', $c) ? implode('_', $c) . '_' . $record['id'] : $record['id']);

You'll need to modify some of the variables ($record['id'] for example) but shouldn't be too hard to figure out.

Sigh... Bobby, I'm very glad you figured this out. And I'm proud that I think I figured out which *file* in this contrib to modify - /includes/classes/category_tree.php, right? But beyond that, I'm clueless. No idea which lines to change, how to change variables, etc. Unfortunately I just haven't had the time to dig into php; I'm slowly learning by osmosis, but my incredibly full-time teaching schedule prevents me from really programming.

 

So, thanks for the starter, but what would you recommend for a next step? Should I contact the author of the sitemap contrib and point him/her to this thread, asking for the contrib to be updated? Or do you plan to do something about it? In any case, I appreciate all your hard work so far.

 

Take care,

Susan

Link to comment
Share on other sites

Hi Bobby

Can you please tell me which sitemap contribution you are referring to. There are many available and I want to install the best one for SEO purposes.

 

Thanks

Elizabeth

I have already fixed your sitemap here: Antiques & Old World Charms

 

If you want to use another just send me the URL and I'll get in there and fix it up for you.

Sigh... Bobby, I'm very glad you figured this out. And I'm proud that I think I figured out which *file* in this contrib to modify - /includes/classes/category_tree.php, right? But beyond that, I'm clueless. No idea which lines to change, how to change variables, etc. Unfortunately I just haven't had the time to dig into php; I'm slowly learning by osmosis, but my incredibly full-time teaching schedule prevents me from really programming.

 

So, thanks for the starter, but what would you recommend for a next step? Should I contact the author of the sitemap contrib and point him/her to this thread, asking for the contrib to be updated? Or do you plan to do something about it? In any case, I appreciate all your hard work so far.

 

Take care,

Susan

Give me an URL to the contribution that you are using and I'll upload a version that is compatible...

 

Bobby

Link to comment
Share on other sites

Bobby, you can check me out here: Lingerie

 

Please notice when you first go in the session ids are still appended to my categories, whilst I visited that person site above me - and they are wrapped properly right from the beginning. I still think this is the problem. Maybe I should uninstall the old version and reinstall the new. Also the new version sends perm redirects from the old sessions ids.

 

I'm not asking you to fix my store bobby. I am asking for verification that everything is working as to be expected as it seems others are having results totally different than myself.

 

DO a site"mysite" on msn to see what I am talking about...looked at the cached dates.

 

The thing that kills me is that google has done 2 deep crawls and I haven't been indexed yet. Just one link to root. Blah...

 

 

 

BTW - WHich Site map DO you suggestion please?

S

Edited by Sincraft
Link to comment
Share on other sites

Give me an URL to the "Sitemap" contribution that you are using and I'll upload a version that is compatible...

Bobby,

The contribution is Site Map MS2-2.2

http://www.oscommerce.com/community/contributions,2208

 

The file to be changed is:

catalog/includes/classes/category_tree.php

 

Thank you,

Eric_K

Link to comment
Share on other sites

Hello Bobby,

 

I am receiving the following error:

Fatal error: Call to undefined function: tep_get_parent_categories() in /home/shop/public_html/catalog/includes/seo_cache.php on line 175

 

I am using an older snapshot of MS2 I have set it up on newer versions without any problems.  I have a client with an older version of 2.2 and need it to work. Any idea on what I can do to fix this error or any help would be greatly appreciated!

 

Thanks!

*

 

Open an MS2 store and cut-n-paste the function from includes/functions/general.php

 

You may also need to do that for tep_output_string() based on when the CVS was grabbed.

 

Bobby

 

Hi Bobby,

 

I tired copying the function below to seo-cache.php and it returned an error. (Fatal error: Cannot redeclare tep_get_parent_categories() (previously declared in /home/shop/public_html/catalog/includes/seo_cache.php:176) in /home/shop/public_html/catalog/includes/seo_cache.php on line 176 )

 

  // TABLES: categories
 function tep_get_parent_categories(&$categories, $categories_id) {
   $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'");
   while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
     if ($parent_categories['parent_id'] == 0) return true;
     $categories[sizeof($categories)] = $parent_categories['parent_id'];
     if ($parent_categories['parent_id'] != $categories_id) {
       tep_get_parent_categories($categories, $parent_categories['parent_id']);
     }
   }
 }

////

 

After that I then reverted the files back to default then tried replacing includes/functions/general.php with the newest snapshots "general.php" and received the same error as before Fatal error: Call to undefined function: tep_get_parent_categories() in /home/shop/public_html/catalog/includes/seo_cache.php on line 175

 

Am I editing the correct files? I assumed you wanted me to copy the function from includes/functions/general.php to includes/seo-cache.php, but what I tried didn?t work. If you have any other suggestions that would be great!

 

Again thanks for your time!

Link to comment
Share on other sites

...

I'm not asking you to fix my store bobby.  I am asking for verification that everything is working as to be expected as it seems others are having results totally different than myself.

...

The thing that kills me is that google has done 2 deep crawls and I haven't been indexed yet.  Just one link to root.  Blah...

...

BTW - WHich Site map DO you suggestion please?

I have checked your site with cookies enabled and without. Your store is functioning correctly from the client perspective.

 

Why is Google not indexing past the front page? I would look at your linking strategy.

 

I don't suggest a sitemap for SEO purposes. A sitemap is for the customer...not search engines. I suggest installing an all_products contribution instead.

Bobby,

The contribution is Site Map MS2-2.2

http://www.oscommerce.com/community/contributions,2208

 

The file to be changed is:

catalog/includes/classes/category_tree.php

 

Thank you,

Eric_K

I'll download and upload a compatible version. It will be clearly marked.

btw I just now turned Gzip on because people were saying I should to 'speed' things up and to optimize my database, whatever that means ehhe.  Is this compatible with that?

 

S

It does nt matter whether you GZIP the content or not...the contribution will function correctly.

Wouldn't it be easier just to install this..

 

http://www.oscommerce.com/community/contributions,2796

 

What are the differences or advantages between the two...

Any other contributions for Search engine Friendly...

That contribution is one of the most server intensive mods I have ever seen. Also, it is still under heavy development and I would not consider it stable enough for a production environment.

 

However, your mileage may vary...install it if you want. It's your store and your decision.

Hi Bobby,

 

I tired copying the function below to seo-cache.php and it returned an error. (Fatal error: Cannot redeclare tep_get_parent_categories() (previously declared in /home/shop/public_html/catalog/includes/seo_cache.php:176) in /home/shop/public_html/catalog/includes/seo_cache.php on line 176 )

 

< snip code >

 

After that I then reverted the files back to default then tried replacing includes/functions/general.php with the newest snapshots "general.php" and received the same error as before Fatal error: Call to undefined function: tep_get_parent_categories() in /home/shop/public_html/catalog/includes/seo_cache.php on line 175

 

Am I editing the correct files? I assumed you wanted me to copy the function from includes/functions/general.php to includes/seo-cache.php, but what I tried didn?t work. If you have any other suggestions that would be great!

 

Again thanks for your time!

You are using a CVS version and one that may or may not be fully compatible. I can't support your release as the contribution was coded for a MS2 codebase. I'm sure it can be ported but this thread is for MS2 support...not CVS.

 

If you are having a duplicate function error remove one of them.

Bobby, I just want to clarify one more point.  Files like this /popup_image.php?pID=43  should not be wrapped correct?

 

S

Those URL's won't be wrapped since it is not a product or category page.

 

Bobby

Link to comment
Share on other sites

Wouldn't it be easier just to install this..

 

http://www.oscommerce.com/community/contributions,2796

 

What are the differences or advantages between the two...

Any other contributions for Search engine Friendly...

 

That was the first one I tried. The install instructions were poor and hard to follow, and the support was not so great either. This one is much better, IMO.

 

Susan

Link to comment
Share on other sites

The sitemap is uploaded here: http://www.oscommerce.com/community/contributions,2208

 

To install just download and overwrite your current includes/classes/category_tree.php file.  Of course, make a backup first.

 

Bobby

 

Works great, Bobby, thanks! :-) If anyone wants to see it in action -- Site map.

 

Susan

Link to comment
Share on other sites

Hi Chemo

 

i've tried your contrib and love it (http://www.forless.ch). but i just learned that there's a serious login problems with firefox. I get a redirection limit error. interestingly the user is logged in, but only notices that if he aborts and clicks on the account manager. Disabling your contrib i can login again.

 

IE seems to be fine.

 

Thanks for your (or anybody elses) help

Pino

Link to comment
Share on other sites

I assume you are referring to the redirect patch? For the record it is beta code and not all of the bugs are worked out. However, as there is more feedback the changes will be rolled into the patch and eventually include it with the contribution release.

 

IMO, once we get the automatic redirect developed and bug free this contribution will truly be the ultimate solution. It will take some time to work out the bugs but one step at a time will get us there...

 

Bobby

Link to comment
Share on other sites

@bobby

 

Is there a problem with ultimate seo 2.0 and the meta tag information for each product?

 

I try this one and the reults seems not so good, no meta information?

 

http://www.google.com/search?q=site:trendfabrik.com

 

Can you help?

 

Greets,

panzz

I'm going to take a guess and assume that you had the SEO URLs turned on for a few days (maybe a week) and then turned them off for whatever reason. Am I right?

 

I don't think it is an issue with the contribution. I have verified on all my client sites that it works and pulls all the meta content flawlessly. Also, notice how some of your SEO URLs are indexed with meta data and others are not. The ones with good meta data were cached on 9 February 2005. It appears that you are getting a 48-72 hour cache refresh so I would suggest waiting for a few more days.

 

Bobby

Link to comment
Share on other sites

Hey Bobby,

Thanks for the replies. I appreciate you taking a looksee too.

 

Should I be clearing / refreshing my cache with that little refresh button or your outcache folder any time or just it ride?

 

Thanks again for all your help, AND PATIENCE! :)

 

S

Link to comment
Share on other sites

Update: Rechecked whole installation and discovered that i was missing some changes which were made in v2.0a. (i'm using this since the first version and upgraded since). everything is working fine now !

 

Great stuff (and yes: it does help with the search engines!)

 

Hi Chemo

 

i've tried your contrib and love it (http://www.forless.ch). but i just learned that there's a serious login problems with firefox. I get a redirection limit error. interestingly the user is logged in, but only notices that if he aborts and clicks on the account manager. Disabling your contrib i can login again.

 

IE seems to be fine.

 

Thanks for your (or anybody elses) help

Pino

Link to comment
Share on other sites

Hey Bobby,

Thanks for the replies. I appreciate you taking a looksee too. 

 

Should I be clearing / refreshing my cache with that little refresh button or your outcache folder any time or just it ride?

 

Thanks again for all your help, AND PATIENCE! :)

 

S

It should not be reset except under very specific circumstances. When you make a change or it becomes stale it will purge itself.

 

Update: Rechecked whole installation and discovered that i was missing some changes which were made in v2.0a. (i'm using this since the first version and upgraded since). everything is working fine now !

 

Great stuff (and yes: it does help with the search engines!)

I'm glad you didn't wait a few days then! :)

 

Bobby

Link to comment
Share on other sites

First:

 

I don't think my mod is so server intensive!

 

http://www.oscommerce.com/community/contributions,2796

 

It still is around 0.12 loading times. That is around the same as oSCommerce normally gives.

 

Also comparing two arrays is alot quicker than pulling information from MySQL database.

 

Some people actually pull entire databases into PHP or which ever programming language they are using because it is quicker and less likely for the database to crash.

 

Secondly:

 

As I said in a previous post my method of having your URL?s is alot better than yours because it does not show what technology is behind the website. It is the same as what DMOZ uses and is what a few other PHP packages have started to use. Mambo uses this type of URL enhancement as well called advanced URL.

 

You use caching and yes you are right that caching is a lot faster, but unless you are running on a < 1000 MHz web server or with a large amount of websites on the one server than it doesn?t matter too much!

 

As for install instructions you only need to change two scripts and the .htaccess which I don?t think so hard!

 

I think people only find it hard when they are not very good with PHP.

 

If any one still wants to have caching and still use my mod it is very easy to do. All though I still finding your page cache script very buggy with our without my mod!

Link to comment
Share on other sites

First:

 

I don't think my mod is so server intensive!

 

It still is around 0.12 loading times. That is around the same as oSCommerce normally gives.

 

Also comparing two arrays is alot quicker than pulling information from MySQL database.

First, don't come onto my thread like you know what you're talking about. Have you tested your server load on a store with 1,000 products? With 5,000 products? The fact is your code is not scalable.

 

Have your tried to EXPLAIN your queries? Do you have any idea of what your contribution will do to a store with more than a few products and even moderate traffic? It will bring it to its knees. Period.

 

Secondly:

 

As I said in a previous post my method of having your URL?s is alot better than yours because it does not show what technology is behind the website. It is the same as what DMOZ uses and is what a few other PHP packages have started to use. Mambo uses this type of URL enhancement as well called advanced URL.

Secondly, you think your URL formation is better than the method I chose but that is your opinion. Do you have data to back up that claim? Hold on...DMOZ uses it so it must be correct. You ignorant fool...they use that method of URLs because it is truly a flat file data structure they utilize. Do your damn homework before you come to me with an attitude. DMOZ uses a Berkley database and generates static HTML files and directories. So, that is a true directory structure. Guess what? Google uses the same flat file stucture.

 

There is a saying: it is best to keep you mouth closed and be thought of as a dipshit than to open it and remove all doubt.

 

You use caching and yes you are right that caching is a lot faster, but unless you are running on a < 1000 MHz web server or with a large amount of websites on the one server than it doesn?t matter too much! 

Are you kidding or just not facing reality?? The majority of store owners are on a shared server where every mb of memory is managed. It doesn't matter? You have lost your mind.

 

I think people only find it hard when they are not very good with PHP.

hhhmmm...how many store owners are PHP developers? Once again, you are out of touch with who is actually using your contribution.

 

If any one still wants to have caching and still use my mod it is very easy to do. All though I still finding your page cache script very buggy with our without my mod!

Maybe you do find the page cache script buggy...but then again a real developer would fix it and upload a better version. Instead of bitching about it why not put your code where your mouth is and do a better job? What? You can't fix it? Then STFU.

 

Bobby

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...