Jump to content
Chemo

[Contribution] Ultimate SEO URLs - by Chemo

Recommended Posts

I'm not sure where to start.....

 

Bobby, I have spent several hours reading your support theads and I'm very impressed! I would like to improve my URL's and I think I have gotten a little mixed up here. My store is pretty small and fairly stock. I'm hoping you or one of the other fine folks here can get me pointed in the right direction.

 

I found a contibution called "seo redirect beta3" and tried to install it, when I did not find the "snippit" in application_top.php as called out in the install directions I realized the contribution said it was built on the cName and pName contirbution; now this does not necessarily tell a greeny like myself if I need to install the cName first but I decided that would be the best thing to do.

 

It sure looks simple although I have not had success, here is what I've done and the results. I followed the install directions very closely although I don't understand this statement:

 

You will need to edit these two files and fill in the correct value for the $cache_dir variable. I would suggest creating a folder OUTSIDE your webroot and give the webserver read/write permission.

 

Is this related to my admin panel defining the Cache directory as /tmp/ ?

 

I am not sure if I have entered the correct path in seo_cache.php because I don't really understand what the path points to, this is how I have it now:

 

# Enter the FULL FILE SYSTEM PATH to the cache directory.  Include the ending slash

  $cache_dir = '/home/e-lectro/public_html/ecommerce/os/catalog/includes/';

 

 

 

I had Cache disabled from my admin, so I enabled it and the directory for it is: /tmp/

Well, I can't find a folder anywhere on my server called /tmp/ ?

Ignoring this and adding the two files provided and making the other required file edits when I log into my store I get this:

 

cName.jpg

 

I can easily undo the file changes at this point, what I really need is some direction as to what steps I need to follow to improve my URL's using Bobby's contributions assuming my MS2 install were totally stock. From my point of view there are several contributions and I don't know if I need just one or several of them to build on each other.

 

Your comments are greatly appriciated, thanks a million!

Share this post


Link to post
Share on other sites

I just found that I did not edit the path of both files, now that I have done that I created a folder in /catalog/includes/ called TMP/ and pointed the pathes at this folder. Now when I log into my web store the body is missing and I only see the left tables, here is a shot:

 

cName2.jpg

 

I see that a file is created in this new TMP folder called seo_english.cache

 

I'm getting closer but I would still appreciate some big picture advice and comments on my current errors.

 

Thanks!

Share this post


Link to post
Share on other sites

Mark,

 

I'm about to release the v2.1 which makes for the most simple installation known to osCommerce. The contribution is literally like a module to install. So, I recommend you hold off and install the v2.1 as it will eliminate all your issues.

 

For the rest of the SEO store owners:

 

I have just released the Google XML Sitemap Feed which is the perfect compliment to SEO URLs :) However, there may be a slight issue with the cache method used in < 2.0b. So, I recommend that if you currently have SEO URLs installed DO NOT INSTALL UNTIL YOU UPGRADE TO V2.1

 

If you do please verify the generated XML files for proper URL formation! If all URLs are correct than no worries...if they are using cPath/products_id's you'll need to upgrade to v2.1

 

Bobby

Share this post


Link to post
Share on other sites

Thanks Bobby, your contributions to the community and commitment to helping is incredible!

 

I will back out the files I have changed and stay posted for your next release.

Share this post


Link to post
Share on other sites
Thanks Bobby, your contributions to the community and commitment to helping is incredible!

 

I will back out the files I have changed and stay posted for your next release.

Hey Bobby,

 

if ure still looking for someone to test ure new release, i'd be more than happy to do it for u - i've got a site in the works atm - www.surferswarehouse.co.uk - and one of the biggest bug-bairs is that the infopages arent covered by ure SEO urls - but yeh, if ure in need of someone to test, drop me a pm and i'd be more than happy to help.

 

Cheers

Fatmcgav

Share this post


Link to post
Share on other sites

I just wanted to drop a quick update note to everyone...

 

First, the Google XML Sitemap contribution is now fully compatible with Ultimate SEO URLs <= 2.0b. So, install away! :) I'm excited over the possibilities with the new XML sitemaps...I believe that it is cutting edge and will prove to be extremely beneficial to every store.

 

Second, I'm almost done with the last part of the Ultimate SEO URLs v2.1 release. Once I get the information pages coded it'll be ready for release. All those that wanted SEO URLs for articles will love this release! Here are the additional features with the v2.1 release:

 

1) More refined, optimized, and native cache logic

2) Ability to choose between cache and no cache (more queries)

3) Ability to turn of cache method for any area (products, cats, articles, etc)

4) Automatic redirection logic is native to the class

5) Redirect logic can be toggled on/off through AdminCP

6) Support for custom character conversions

7) Ability to remove all non-alphanumeric characters (very powerful)

8) Ability to use the class for admin side data feeds (Froogle, etc)

8) MORE SEO PAGES!

-- Products

-- Categories

-- Popup Images

-- Product Reviews

-- Product Reviews Info

-- Article Topics

-- Articles Info

-- Information Pages (almost done!)

 

Stay tuned for the release!

 

Bobby

Share this post


Link to post
Share on other sites

LOL, I came here to say thanks for the 2.1 release and also to inquire about a USEO URL supported contrib for the G Sitemap.

 

And it's already done by Mr Bobby himself already.

 

Well done and thanks!

 

Joe a.k.a. T0PS3O


Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Share this post


Link to post
Share on other sites

You have an unusual problem with cPath=0_* as that is not the usual form. The 0 indicates top level category and should be formed like cPath=1 and NOT cPath=0_1. Do you have a custom category menu?

 

Yes i suppose i do because this is the top/home link in the categorie box

 

I am interested in utilizing your store to finish development since it meets all of the requirements: articles, informations pages, and also has the added bonus of being a large product category with possible multiple languages.

 

Get with me on instant messenger and we'll work out the FTP credentials.

 

I have installed your contribution update 2.01 and the other upgrade i will start testing this later in the evening and i will e-mail my site-adres to you. I cannot give my ftp credentials due to the fact it is live and functioning, even i must inform my fellow shoprunners before modifying anything

 

BTW, do you have issues with special characters in the URLs? How many characters as an estimate?

 

I am not sure what you mean by this these caracters are also put in the rewrited url say example a trademark or copyright , will be parsed within the url . But the link will work when clicked on

 

Regards Hakan


Kind regards

 

Hakan Haknuz

Share this post


Link to post
Share on other sites
Let me finish this 2.1 release and we'll approach the issue later...sounds like an issue somewhere with tep_get_all_params()

I'm having the same problem with manufacturers. The It seems that once I've I click on the manufatcturer from the list and the products come up that if I click on the manufaturer I should go to the manufacturers URL. If not, then why did I put all those manufacturer URLs in? :blush: Instead, I get kicked back to the index. If it's not the fault of your script, you are truly forgiven, Hell if it IS the fault of your script I ain't bitchen, small price to pay. .....BUT (ya know that HAD to be in there) It would be nice having it work that way. I'm not absolutely certain it worked correctly even on a fresh install, I never tried clicking on a manufacturer the second time till after your script was installed. Just seems an awful waste adding all those URLs without it.

Share this post


Link to post
Share on other sites

One thing i found was that when using the default settings .

The reset option didn't work.

The turn seo off switch didn't work, when i turned it off my site wasn't able to load normal cpath values this means they entire categorie box.Also products wouldn't load.

I tried putting oscdefaultcache off and page_cache also your 7 caches in configuration.

I deleted all cache files and cleared cache in database.

No help there, it seems like im tied to put seo on.

I shall put things back on and test this later in the evening because i really don't want to bother visitors or spiders

Come to think of it maybe this is because the htacces file has still rewrite on..

I suppose the switch set SEO off cannot remove these rules from the htacces file..but i will test some more this night

 

regards hakan

Edited by hakan haknuz

Kind regards

 

Hakan Haknuz

Share this post


Link to post
Share on other sites

Chemo

 

KNOWN ISSUES

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

1) Class is not compatible with page_cache contribution. Plans are to offer support in the next release.

Shouldn't changing 'in_array' to '@in_array' in 'seo.class.php' do the trick? I encountered similar issues with page_cache and one of my contributions.


· willross

··········

Share this post


Link to post
Share on other sites

Possible Bug

Bobby, excellent job. Thank you for your work and contributions.

 

After installing ultimate SEO v2.1, I tried to get rid of the "?osCsid=xxxxxxxxxxxxx" portion of the url by forcing cookie use ... with either IE or firefox, both accepting cookies, customers cannot login and get the "cookies must be enabled" warning. This does not happen without SEO.

 

Regards,

-D

Share this post


Link to post
Share on other sites

Hey Bobby, I read on one of the forums that you have been banned. I hope that isn't the case.

 

Thanks for the new SEO contribution, great job. It fixed my problems that I had when the buy now button was clicked it was taking me to a different category.

Share this post


Link to post
Share on other sites
Sheesh.  I'm an idiot.  First I didn't even provide the correct line of code.  Second, I figure it out.  heh.

 

Sorry for all the posts!

 

Can you tell me how you got Froogle feed to work with this?

Share this post


Link to post
Share on other sites
found the problem with the buynow stuff.  i had been searching the posts and had tried various things people had recommended before posting and one of them was to change application_top.php in the case for buy_now from GET to POST or vice versa - don't recall.  Anyway, changed it back and all is well.  sorry for the trouble.  thanks for the quick assistance on this too.

 

Hi,

 

What was your solution with the buy_now going to an empty shopping cart when not logged in? I am experiencing the same problem, and it only started since I installed this SEO contribution (even though it is currently turned off).

 

I was hoping to launch the new website with the SEO this week but with this now not working I obviously cannot launch it.

 

Any help will be greatly appreciated.

 

Cheers,

Chris

Share this post


Link to post
Share on other sites

From reading some posts in these forums, and looking into it further, I believe the problem is that the URL uses &amp (instead of just & to pass on the values). How does this get fixed?

 

Is there any SEO disadvantages of changing it from &amp to just &

?

 

 

Cheers,

Chris

Share this post


Link to post
Share on other sites
I think I have worked out the problem.

 

This site helped me to fix it: http://www.faqts.com/knowledge_base/view.p.../aid/1151/fid/8

 

I needed to change my php.ini:

Change session.save_path=/tmp to session.save_path= ;

 

Now it is accepting & in the URL's. Woohoo.

 

Cheers,

Chris :)

 

Actually, I had to change it from session.save_path = "C:\php4\sessions" to session.save_path = ;

 

Any idea whether this will cause any problems on my development computer?

 

Cheers,

Chris

Share this post


Link to post
Share on other sites
Actually, I had to change it from session.save_path = "C:\php4\sessions" to session.save_path = ;

 

Any idea whether this will cause any problems on my development computer?

 

Cheers,

Chris

 

 

SEO URLS using mod rewrite will not work on windows... you will have to use cName (older version)

 

 

New version has settings (Enable automatic redirects?)

 

 

Chris


osC Contributions I have published.

 

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

Share this post


Link to post
Share on other sites

I have a problem... since I installed Ultimate SEO URLs v2.0b my Header Tag Controller don?t work. There are always the default title, keyword and description but not the title, keyword an description from the products or the categories.

 

I check the Ultimate SEO installation... but I couldn?t find any error at the installation.

I think there must been an error in the catalog/includes/application_top.php in this part:

# include the cache class

include('includes/classes/cache.class.php');

$cache = new cache($languages_id);

# include the Ultimate SEO URLs cache file

include('includes/seo_cache.php');

# Get the cache - no parameters will get all GLOBAL cache entries for this language

$cache->get_cache('GLOBAL');

 

 

if ( isset($HTTP_GET_VARS['cName']) && defined(urldecode($HTTP_GET_VARS['cName'])) ) {

$cPath = str_replace( 'cPath=', '', constant(urldecode($HTTP_GET_VARS['cName'])) );

$HTTP_GET_VARS['cPath'] = $cPath;

}

if (isset($HTTP_GET_VARS['pName']) && defined(urldecode($HTTP_GET_VARS['pName'])) ) {

$pid = str_replace('products_id=', '', constant(urldecode($HTTP_GET_VARS['pName'])));

$HTTP_GET_VARS['products_id'] = (int)$pid;

}

 

or in the catalog/includes/functions/html_output in this part:

function implode_assoc($array, $inner_glue='=', $outer_glue='&') {

      $output = array();

      foreach( $array as $key => $item )

              $output[] = $key . $inner_glue . $item;

 

      return implode($outer_glue, $output);

}

 

function short_name($str, $limit=3){

if (defined('SEO_URLS_FILTER_SHORT_WORDS')) $limit = SEO_URLS_FILTER_SHORT_WORDS;

$foo = explode('-', $str);

foreach($foo as $index => $value){

  switch (true){

  case ( strlen($value) <= $limit ):

    continue;

  default:

    $container[] = $value;

    break;

  } 

} # end foreach

$container = ( sizeof($container) > 1 ? implode('-', $container) : $str );

return $container;

}

 

////

// The HTML href link wrapper function

  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {

    global $request_type, $session_started, $SID;

 

$seo = ( defined('SEO_URLS') ? SEO_URLS : false );

$seo_rewrite_type = ( defined('SEO_URLS_TYPE') ? SEO_URLS_TYPE : false );

$seo_pages = array('index.php', 'product_info.php');

if ( !in_array($page, $seo_pages) ) $seo = false;

 

    if (!tep_not_null($page)) {

      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');

    }

 

if ($page == '/') $page = '';

 

    if ($connection == 'NONSSL') {

      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

      $seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

  $seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

    } elseif ($connection == 'SSL') {

      if (ENABLE_SSL == true) {

        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;

        $seo_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;

        $seo_rewrite_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;

      } else {

        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

        $seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

        $seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;

      }

    } else {

      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');

    }

 

    if (tep_not_null($parameters)) {

      $link .= $page . '?' . tep_output_string($parameters);     

  $separator = '&';

 

  # Start exploding the parameters to extract the values

  # Also, we could use parse_str($parameters) and would probably be more clean

  if ($seo == 'true'){

  $p = explode('&', $parameters);

  krsort($p);

  $params = array();

 

  if ( $seo_rewrite_type == 'Rewrite' ){

    foreach ($p as $index => $valuepair) {

    $p2 = explode('=', $valuepair);   

    switch ($p2[0]){   

    case 'products_id':

      $rewrite_product = true;     

      if ( defined('PRODUCT_NAME_'.$p2[1]) ){

      $rewrite_page_product = short_name(constant('PRODUCT_NAME_'.$p2[1])) . '-p-' . $p2[1] . '.html';

      } else { $seo = false; }

      break; 

   

    case 'cPath':

      $rewrite_category = true;

      if ( defined('CATEGORY_NAME_'.$p2[1]) ){

      $rewrite_page_category = short_name(constant('CATEGORY_NAME_'.$p2[1])) . '-c-' . $p2[1] . '.html';

      } else { $seo = false; }

      break;

// manufacturer addition by WebPixie

    case 'manufacturers_id':

      $rewrite_manufacturer = true;

      if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){

      $rewrite_page_manufacturer = short_name(constant('MANUFACTURER_NAME_'.$p2[1])) . '-m-' . $p2[1] . '.html';

      } else { $seo = false; }

      break;

// end manufacturer addition by WebPixie

    default:

      $params[$p2[0]] = $p2[1];

      break;

    } # switch

    } # end foreach

    $params_stripped = implode_assoc($params);

    switch (true){

    case ( $rewrite_product && $rewrite_category ):

    case ( $rewrite_product ):

      $rewrite_page = $rewrite_page_product;

      $rewrite_category = false;

      break;

    case ( $rewrite_category ):

      $rewrite_page = $rewrite_page_category;

      break;

// manufacturer addition by WebPixie

    case ( $rewrite_manufacturer ):

      $rewrite_page = $rewrite_page_manufacturer;

      break;

// end manufacturer addition by WebPixie

    default:

      $seo = false;

      break;

    } #end switch true

    $seo_rewrite_link .= $rewrite_page . ( tep_not_null($params_stripped) ? '?'.tep_output_string($params_stripped) : '' ); 

    $separator = ( tep_not_null($params_stripped) ? '&' : '?' );

  } else {

    foreach ($p as $index => $valuepair) {

    $p2 = explode('=', $valuepair);   

    switch ($p2[0]){   

    case 'products_id':     

      if ( defined('PRODUCT_NAME_'.$p2[1]) ){

      $params['pName'] = constant('PRODUCT_NAME_'.$p2[1]);

      } else { $seo = false; }

      break; 

   

    case 'cPath':

      if ( defined('CATEGORY_NAME_'.$p2[1]) ){

      $params['cName'] = constant('CATEGORY_NAME_'.$p2[1]);

      } else { $seo = false; }

      break;

// manufacturer addition by WebPixie

    case 'manufacturers_id':

      if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){

      $params['mName'] = constant('MANUFACTURER_NAME_'.$p2[1]);

      } else { $seo = false; }

      break; 

// end manufacturer addition by WebPixie 

    default:

      $params[$p2[0]] = $p2[1];

      break;

    } # switch

    } # end foreach 

    $params_stripped = implode_assoc($params);

    $seo_link .= $page . '?'.tep_output_string($params_stripped); 

    $separator = '&';

  } # end if/else

  } # end if $seo

} else {

      $link .= $page;

      $separator = '?';

  $seo = false;

    } # end if(tep_not_null($parameters)

 

    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

 

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined

    if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {

      if (tep_not_null($SID)) {

        $_sid = $SID;

      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {

        if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {

          $_sid = tep_session_name() . '=' . tep_session_id();

        }

      }

    }

 

    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {

      while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

      while (strstr($seo_link, '&&')) $seo_link = str_replace('&&', '&', $seo_link);

 

      $link = str_replace('?', '/', $link);

      $link = str_replace('&', '/', $link);

      $link = str_replace('=', '/', $link);

      $seo_link = str_replace('?', '/', $seo_link);

      $seo_link = str_replace('&', '/', $seo_link);

      $seo_link = str_replace('=', '/', $seo_link);

      $seo_rewrite_link = str_replace('?', '/', $seo_rewrite_link);

      $seo_rewrite_link = str_replace('&', '/', $seo_rewrite_link);

      $seo_rewrite_link = str_replace('=', '/', $seo_rewrite_link);

 

      $separator = '?';

    }

 

if (isset($_sid)) {

  $link .= $separator . $_sid;

    $seo_link .= $separator . $_sid;

    $seo_rewrite_link .= $separator . $_sid;

}

 

if ($seo == 'true') {

  return ($seo_rewrite_type == 'Rewrite' ? $seo_rewrite_link : $seo_link);

} else {

  return $link;

}

  }

 

or maybe there is a problem in the includes/seo_cache.php or the includes/classes/cache.class.php

Share this post


Link to post
Share on other sites

After i apply this. Buy Now button on product display page is not working. It takes me to shopping cart page but shows shopping cart empty.. any idea what was wrong with it?

Share this post


Link to post
Share on other sites

Kamil

 

Turn off search engine safe urls in admin and see if that changes anything

 

The error you have unable to determine page link I have seen before and that is what was causing it

 

regards

 

mark


Regards

 

Mark A Reynolds

Share this post


Link to post
Share on other sites
After i apply this. Buy Now button on product display page is not working. It takes me to shopping cart page but shows shopping cart empty.. any idea what was wrong with it?

 

The same thing has happened to me. I have no idea how to fix it.

 

Does anyone else know how to get the buy now button back working? The code all looks fine.

 

It has only stopped working since installing the Ultimate SEO contribution.

 

Any help would be greatly appreciated.

 

Cheers,

Chris :)

Share this post


Link to post
Share on other sites
Kamil

 

Turn off search engine safe urls in admin and see if that changes anything

 

The error you have unable to determine page link I have seen before and that is what was causing it

 

regards

 

mark

 

Hi Mark,

 

no that wasn?t the problem. The search engine safe urls are off.

Did you have any other ideas?

 

 

-Kamil

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×