This contribution will add the new canonical url link tag to your osCommerce webshop. The canonical link tag was recently introduced by Google, Yahoo! and Live and tells the search engines which URL it should have for the current page. This will prevent that content available on irregular urls will not be tagged as duplicate content.
This contribution will improve indexation of your website and prevent duplicate content.
For more information about the canonical url link tag visit: http://www.webshoptimizer.com/canonical-links-for-oscommerce-beta/
Legend: 
Download

Report
I asked the original creator of this contribution, Mathieu from webshoptimizer.com to see if I could use this contribution to redirect search engines to the right URL without the affiliate references.
All credits go to webshoptimizer.com
Here is the Solution
okay i figured out a rough way to fix the problem.
it looks like the author was looking to remove trailing slashes in the url. however my server doesn't put this trailing slash so it was making my .com or .net into .co and .ne
$domain = substr((($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER), 0, -1); // gets the base URL minus the trailing slash
Remove the [, -1] from the code
so it looks like this
$domain = substr((($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER), 0); // gets the base URL minus the trailing slash
works fine for me now.
This contribution will add the new canonical url link tag to your osCommerce webshop. The canonical link tag was recently introduced by Google, Yahoo! and Live and tells the search engines which URL it should have for the current page. This will prevent that content available on irregular urls will not be tagged as duplicate content.
This contribution will improve indexation of your website and prevent duplicate content.
For more information about the canonical url link tag visit: http://www.webshoptimizer.com/canonical-links-for-oscommerce-beta/