Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

You will get the osCsid appended on the first page load but on first click it should be pulled from the cookie.  That is normal operation of a properly configured store.

Yes...you need to make sure mod_rewrite is enabled on your server.

Your issue is unique...what is causing it is still a mystery.

I am working on an automatic 301 header redirect code block and should have it completed shortly.  If you want a sneak peek here it is:

	if (SEO_URLS == 'true'){
 $request_uri = ltrim($_SERVER['REQUEST_URI'], '/');
 $name_query_str = basename($_SERVER['SCRIPT_NAME']) . '?' . $_SERVER['QUERY_STRING'];
 $path_info = ltrim(getenv('PATH_INFO'), '/');
 $url_array = parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $_SERVER['QUERY_STRING']);
 
 $seo_page = ( ($url_array['path'] == FILENAME_DEFAULT || $url_array['path'] == FILENAME_PRODUCT_INFO) ? true : false );
 $cname = ( eregi("(cName|pName)", $request_uri) ? true : false );
 $mID = ( eregi("(manufacturer)", $request_uri) ? true : false );
 
 switch (true){
	 case ( !$seo_page ):
   break;
	 
	 case ( strlen($path_info) > 0 ):
   $tmp = explode('/', $path_info);
	 
   if ( sizeof($tmp) > 2 ){
  	 $container = array();
  	 for ($i=0, $n=sizeof($tmp); $i<$n; $i++) {
     $container[] = $tmp[$i] . '=' . $tmp[$i+1]; 
     $i++;
  	 }
  	 $params = implode('&', $container);
   } else {
  	 $params = implode('=', $tmp);
   }    
   echo $params;
   $url = tep_href_link($url_array['path'], $params);
   break;
	 
	 case ( ($request_uri == $name_query_str) && (!$cname) && (!$mID) ):    
   $url = tep_href_link($url_array['path'], $url_array['query']);
   break;
   
	 case ( $cname && SEO_URLS_TYPE != 'cName' ): 	 
   $params = array();
   if ( isset($HTTP_GET_VARS['cName']) && defined(urldecode($HTTP_GET_VARS['cName'])) ) {
  	 $params[] = constant(urldecode($HTTP_GET_VARS['cName']));
   }
   if (isset($HTTP_GET_VARS['pName']) && defined(urldecode($HTTP_GET_VARS['pName'])) ) {
  	 $params[] = constant(urldecode($HTTP_GET_VARS['pName']));
   }
   $params = implode('&', $params);
   $url = tep_href_link($url_array['path'], $params);
   break;    
 } # end swithch
 
 if ( tep_not_null($url) ) {
	 header("HTTP/1.0 301 Moved Permanently");
	 header ("Location: $url");
 }  
 
} #end if SEO_URLS

 

It should be noted that this is BETA code and I'm currently testing it on my dev server for every combination that I can think of.  As it is most of the bugs have been worked out but I'm not done testing.  You can install the code if you wish but I will release the final version when I'm done and it may or may not change.

 

Paste the code below the SEO URLs code in application_top.php

 

Bobby

 

 

Thanks, Bobby.

 

It works like a charm :)

 

Donna

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

I have released a patch that addresses the need to redirect old URLs to the new ones. From the release notes:

This is a one file patch to address the issue of URLs that are indexed with search engines and should be redirected.

 

HOW THIS PATCH WORKS

====================

This patch automatically detects which old URL was used (regular stock osC, SEF URLs, or even cName) and sends a 301 moved permanently redirect to the proper page.

 

NOTES

====================

This is beta code. I have tested this patch thoroughly but there is no way for me to catch every possible scenario. If you experience difficulties or errors please post in the support thread.

 

Download here: Ultimate SEO URLs Redirect Patch

 

Bobby

Link to comment
Share on other sites

Thanks again guys for your help, especially Chemo. It looks like my situation may be somewhat unique. I have went to lengths to try and streamline things. I just reconfigured the site back to the root level (so there is no "/catalog") to avoid the redirect I was using before. Now there are no redirects, and no line breaks in descriptions. Still I am getting my SEO software and spider simulating websites returning that product pages have no title, no keywords, and no description.

 

Could someone with this Contribution fully working please do me a quick favor?

Go to this website http://www.webconfs.com/search-engine-spider-simulator.php and enter an HTML based URL from your osCommerce store. The example I was trying was http://coolhotstuff.com/chase-authentics-j...cket-p-165.html and it tells me there is no text to spider and no meta tags or links. The page loads correctly if you view the source code, but am I the only one seeing these problems? Any advice?

 

 

Thanks,

Aaron

Link to comment
Share on other sites

Thanks again guys for your help, especially Chemo. It looks like my situation may be somewhat unique. I have went to lengths to try and streamline things. I just reconfigured the site back to the root level (so there is no "/catalog") to avoid the redirect I was using before. Now there are no redirects, and no line breaks in descriptions. Still I am getting my SEO software and spider simulating websites returning that product pages have no title, no keywords, and no description.

 

Could someone with this Contribution fully working please do me a quick favor?

Go to this website http://www.webconfs.com/search-engine-spider-simulator.php and enter an HTML based URL from your osCommerce store. The example I was trying was http://coolhotstuff.com/chase-authentics-j...cket-p-165.html and it tells me there is no text to spider and no meta tags or links. The page loads correctly if you view the source code, but am I the only one seeing these problems? Any advice?

Thanks,

Aaron

 

 

I tried the site I'm currently working on http://ampalian.com and http://ampalian.com/store/ . All works fine. I see text etc.

 

Tried yours and no good. <snip>wrong post</snip>

 

Paul

Edited by Fourbit
Link to comment
Share on other sites

Thanks again guys for your help, especially Chemo. It looks like my situation may be somewhat unique. I have went to lengths to try and streamline things. I just reconfigured the site back to the root level (so there is no "/catalog") to avoid the redirect I was using before. Now there are no redirects, and no line breaks in descriptions. Still I am getting my SEO software and spider simulating websites returning that product pages have no title, no keywords, and no description.

 

Could someone with this Contribution fully working please do me a quick favor?

Go to this website http://www.webconfs.com/search-engine-spider-simulator.php and enter an HTML based URL from your osCommerce store. The example I was trying was http://coolhotstuff.com/chase-authentics-j...cket-p-165.html and it tells me there is no text to spider and no meta tags or links. The page loads correctly if you view the source code, but am I the only one seeing these problems? Any advice?

Thanks,

Aaron

First, that is a pretty shabby spider simulator. Second, it doesn't report meta tags for any site. Try typing in ebay.com and see if it pulls the meta tags...nope, sure doesn't.

 

Are you buffering your output?

 

Try turning off the SEO URLs and check a regular URL. If you have the same problems this contribution can be eliminated immediately.

 

Bobby

Link to comment
Share on other sites

I tried the site I'm currently working on http://ampalian.com and http://ampalian.com/store/ . All works fine. I see text etc.

 

Tried yours and no good. I was wondering if the frames that you are using is the problem.

 

Paul

 

 

When I clicked on those links for the site you are working on it appeared that there was no content there at all - nothing. It spit back an error in Firefox and IE.

 

As far as the "frames" you referred to I am not sure I follow. Our site design does not use frames.

 

Thanks for the help. I look forward to hearing back from you all.

 

-Aaron

Link to comment
Share on other sites

I installed the SEO_redirect, after this when I call my Shop Url I got something like this:

 

http://www.trendfabrik.com/index.php?index.php

 

What to do?

 

Greets,

panzz

Your install will have to be debugged...

 

When I clicked on those links for the site you are working on it appeared that there was no content there at all - nothing. It spit back an error in Firefox and IE.

 

As far as the "frames" you referred to I am not sure I follow. Our site design does not use frames.

 

Thanks for the help. I look forward to hearing back from you all.

 

-Aaron

I'm not convinced this is a problem with my contribution. Turn off the SEO URLs and then try it again. If the issue is resolved and I see it with my own eyes I'll help you solve the problem free. However, if you turn off the SEO URLs and it does not solve your problem then it is CLEARLY not SEO URLs causing it.

 

Bobby

Link to comment
Share on other sites

Question, Bobby. My URLs are working correctly everywhere but here: Site map. For some reason, all the main categories show as HTML URLs, but subcategories are the old-style URLs. I can't for the life of me figure out why. Do you want me to post the contrib I used to get this, or is it immediately obvious?

 

Thanks so much for the patch - very helpful!

 

Susan

Link to comment
Share on other sites

I have seen that on the MS3 sitemap port for MS2 and also a few other contributions. I have not found the cause nor solution but as soon as I do it will be posted / corrected in the next release.

 

Bobby

Link to comment
Share on other sites

Bobby, wanted to let you know that #1, this is a great contrib. I mean, wow. Mad props to you and who ever else was involved.

 

Well, everything is actually working, but in admin menu I get this error

 

"Warning: call_user_func(tep_reset_cache_data_seo_urls): First argument is expected to be a valid callback"

 

This prevents me from reseting the cache. Any ideas?

Link to comment
Share on other sites

Bobby,

I am still seeing this:?osCsid=a17d56eee79210ab67cd7367dd893358

in all my page rankings. I have done everything you recommended and have spend a LONG time comparing your contrib to others I have installed and stock OSC files, I am no expect at this but these all seem to be completely unrelated with your contrib yet I still am having this trouble.

I downloaded and installed v1.4 - do you suggest I upgrade?

 

S

Link to comment
Share on other sites

Bobby,

I am still seeing this:?osCsid=a17d56eee79210ab67cd7367dd893358 

in all my page rankings.  I have done everything you recommended and have spend a LONG time comparing your contrib to others I have installed and stock OSC files, I am no expect at this but these all seem to be completely unrelated with your contrib yet I still am having this trouble.

I downloaded and installed v1.4 - do you suggest I upgrade?

 

S

 

I seem to have a similar problem to sincraft, for example....

 

http://www.mysite.com/product_info.php?pName=under-siege&osCsid=be1b88e9e8d736e331b3444f4646b09c

 

I can live with it being unsightly, but will this effect the way the contrib works?

I'm using cname as my hosting didn't seem to want to work with rewrite, it couldn't find my product pages :/

Thanks for a very useful contrib btw :thumbsup:

Link to comment
Share on other sites

I seem to have a similar problem to sincraft, for example....

 

http://www.mysite.com/product_info.php?pName=under-siege&osCsid=be1b88e9e8d736e331b3444f4646b09c

 

I can live with it being unsightly, but will this effect the way the contrib works?

I'm using cname as my hosting didn't seem to want to work with rewrite, it couldn't find my product pages :/

Thanks for a very useful contrib btw  :thumbsup:

 

I have the same problem still. I installed the seo_redirct yesterday, but I just saw Googlebot via who's online in admin and the session id was attached to his url.

 

BTW, where do you check your page rankins to see the url's?

Brian Neuman

Link to comment
Share on other sites

I seem to have a similar problem to sincraft, for example....

 

http://www.mysite.com/product_info.php?pName=under-siege&osCsid=be1b88e9e8d736e331b3444f4646b09c

 

I can live with it being unsightly, but will this effect the way the contrib works?

I'm using cname as my hosting didn't seem to want to work with rewrite, it couldn't find my product pages :/

Thanks for a very useful contrib btw? :thumbsup:

 

eheh that is the whole purpose of the contrib and the only purpose, to wrap the urls for search engine optimization. Another thing I noticed, and mind you all these links are after all my tweaks etc. Was that all the files ending in .php with long session ids are being ranked much higher than the very few that are wrapped. Most wrapped files arent being indexed at all. But I can put a new file up say 'links.php' (two days ago) and it is already indexed and higher than all of my other links. I know that is a rather vague statment, but the content on my product pages is MUCH higher than the content in this other pages with php endings.

 

So I am just wondering if I should update or not, and will it really help. I can tell you that I watched google crawling my site for over 8 hours the other day - I am not index AT ALL on google. SO something is wrong with the way google sees my site. Is it this contrib, doubtful, but there IS something it isn't liking for it to deep crawl that much and then spit nothing back, but that was 2 days ago. Both MSN and GOOGLEbots where sitting on my site for hours on end. MSN immediately picked up my new links and indexed them..

And you know how you can see who is online? Well I watch users online and can view their shopping carts. I know something is a spider by when I click on the IP address, it refreshed the screen and ditches the shopping cart all together, so they are not being provided with a visitors cart. (how do I know it's google or msn? Tracert)

 

Suggestions?

 

S

Edited by Sincraft
Link to comment
Share on other sites

Bobby,

I am still seeing this:?osCsid=a17d56eee79210ab67cd7367dd893358 

in all my page rankings.  I have done everything you recommended and have spend a LONG time comparing your contrib to others I have installed and stock OSC files, I am no expect at this but these all seem to be completely unrelated with your contrib yet I still am having this trouble.

I downloaded and installed v1.4 - do you suggest I upgrade?

 

S

Why upgrade? You still have not figured out why you are having this problem. What is your URL? I do not believe that your problems are related to my contribution but rather IN YOUR SETUP AND SETTINGS.

 

Remember, this is not the "fix my store" thread but rather support for those that need help with Ultimate SEO URLs. If the thread gets to be 60 pages long I would like to keep it 60 pages of content rather than 10 pages of support and 50 pages of "fix my store".

 

I have the same problem still.  I installed the seo_redirct yesterday, but I just saw Googlebot via who's online in admin and the session id was attached to his url.

 

BTW, where do you check your page rankins to see the url's?

If Google has a SID attached to his URL than you have an issue with your setup. As we have covered about 20 times in this thread you need to update your spiders.txt file and also set the Prevent Spider Sessions => true. Don't know how? Search this thread.

 

To see what the big G has indexed you can use this syntax:

site:yourdomain.com

This will show you every page from your domain that is currently indexed with Google.

 

Bobby

Link to comment
Share on other sites

I get this error:

 

Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 2949120 bytes)

in /includes/classes/cache.class.php(157) : eval()'d code on line 5462

 

HTTP Server: Apache/1.3.29 (Unix) mod_ssl/2.8.16 OpenSSL/0.9.6k

PHP Version: 4.3.9 (Zend: 1.3.0)

 

 

I don't have access to the server settings so I can't increase the memory.

Does having 6201 products the reason for this?

 

Kevin-

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!

Link to comment
Share on other sites

Why upgrade?  You still have not figured out why you are having this problem.  What is your URL?  I do not believe that your problems are related to my contribution but rather IN YOUR SETUP AND SETTINGS.

 

Remember, this is not the "fix my store" thread but rather support for those that need help with Ultimate SEO URLs.  If the thread gets to be 60 pages long I would like to keep it 60 pages of content rather than 10 pages of support and 50 pages of "fix my store".

If Google has a SID attached to his URL than you have an issue with your setup.  As we have covered about 20 times in this thread you need to update your spiders.txt file and also set the Prevent Spider Sessions => true.  Don't know how?  Search this thread.

 

To see what the big G has indexed you can use this syntax:

site:yourdomain.com

This will show you every page from your domain that is currently indexed with Google.

 

Bobby

 

 

Okay, okay - I'll go search around the forum for more info, but I DO have prevent spiders and googlebot IS listed in spiders.txt. In addition, I thought the seo_redirect would force googlebot to dump the session ID's from previous visits...

Brian Neuman

Link to comment
Share on other sites

I get this error:

 

Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 2949120 bytes)

in /includes/classes/cache.class.php(157) : eval()'d code on line 5462

 

HTTP Server: Apache/1.3.29 (Unix) mod_ssl/2.8.16 OpenSSL/0.9.6k

PHP Version: 4.3.9 (Zend: 1.3.0)

I don't have access to the server settings so I can't increase the memory.

Does having 6201 products the reason for this?

 

Kevin-

That is interesting. I tested this on a server with 22,000 products, 3,000 categories, and some 200 manufacturers. The largest cache (obviously products) chewed up just over 2.3 Mb of memory but lasted for about 5 milliseconds before being purged.

 

Based on my measured memory useage of the script your 6,000 products should utilize roughly 1/4th the memory which is about 600 Kb memory. This is a far cry from the roughly 8 Mb in the error above or even the 3 Mb from the eval() block. This tells me something is wrong but where it is can be hard to detect without serious script debugging.

 

Here are the facts: your script should consume no more than 600Kb memory from the cache but then release it within milliseconds. Your script has already consumed 5 Mb of memory BEFORE it hits the cache portion which consumes an additional 3 Mb (per your error message). These numbers are very large and not usual...something needs to be debugged.

 

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

Link to comment
Share on other sites

Okay, okay - I'll go search around the forum for more info, but I DO have prevent spiders and googlebot IS listed in spiders.txt.  In addition, I thought the seo_redirect would force googlebot to dump the session ID's from previous visits...

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

 

None of your URLs have an osCsid attached? You have more than half that are the new SEO type URLs and same thing...no osCsid's.

 

The seo_redirect is not designed to dump the SID's from spiders but that might be a good idea...

 

Bobby

Link to comment
Share on other sites

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

 

None of your URLs have an osCsid attached?  You have more than half that are the new SEO type URLs and same thing...no osCsid's. 

 

The seo_redirect is not designed to dump the SID's from spiders but that might be a good idea...

 

Bobby

 

I saw that too when I checked - thanks for the info on "site:" (sorry for being such a newbie). I was looking at the url listed in "Who's online" and it showed the session for some reason...

Brian Neuman

Link to comment
Share on other sites

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

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