Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo


Recommended Posts

Hi!!

 

This contribution is great!! Now my web appears in google, thanks chemo :)

 

I have a question, using Ultimate SEO URLs is possible obtain this url's?

 

www.domain.com/category/subcategory/product+name.html

 

How i can do it??

 

Thanks!!

Link to comment
Share on other sites

hi,

 

I have SEO URL in my sites.

 

1. i have problem on first sites load, on category box display short html links

 

http://www.example.com/-c-2.html

 

on Best seller box display :

 

http://www.example.com/-p-19.html

 

after click on onother links, this category and bestseler box will normal

 

http://www.example.com/natural-box-c-2.html

http://www.example.com/nice-box-picture-p-19.html

 

 

2. how to configure manufature and product links

this links always display :

 

http://www.example.com/nice-box-picture-p-...ufacturers_id=4

 

wayan

Link to comment
Share on other sites

Hi all,

 

I have upgraded my SEO URL from V2.0 to V2.1d. I had the older version for some time, using URL format cName, and all my Google links look like this:

 

http://www.beforeyoubuy.org/product_info.php?pName=bioque-serum-xl-1-ounce-bottle

 

With v2.1d I have to use the URL Rewrite Type and my links look like this:

 

http://www.beforeyoubuy.org/bioque-serum-ounce-bottle-p-485.html

 

Enable automatic redirects is set to True, but the page isn't redirecting properly. It seems to be stuck in a loop of redirect attempts. I really wanted to make the switch and keep the old links working. Is it at all possible?

 

thanks

 

Ari

Edited by ari
Link to comment
Share on other sites

I've just installed this mod when i go to my account section it keeps loading the login page and when i complete a test order it completes the order but does not take me back to the home page it just reloads the login page.

 

Can some one help with this please.

Link to comment
Share on other sites

Enable automatic redirects is set to True, but the page isn't redirecting properly. It seems to be stuck in a loop of redirect attempts. I really wanted to make the switch and keep the old links working. Is it at all possible?

 

thanks

 

Ari

Most likely you have CGI mode PHP installation (versus SAPI) and the redirect code will need a few minor tweaks.

 

I just installed this mod on this site - http://www.damnfunnytshirts.com. I cannot get the PHP SIDs to go away even after clicking a few times. Any ideas on what is wrong?

Check your configure.php file and make sure the cookie settings are correct.

 

I've just installed this mod when i go to my account section it keeps loading the login page and when i complete a test order it completes the order but does not take me back to the home page it just reloads the login page.

 

Can some one help with this please.

The contribution should not affect the login portion of the site nor the sessions. You'll most likely have to debug the installation to find out what is going on.

Link to comment
Share on other sites

thanks devx,

 

I am running Apache/2.0.51 (Fedora) and PHP Version: 4.3.11 (Zend: 1.3.0) with the Plesk CP. Hope this tells you the mode in which my PHP is running. Can you tell me what changes to the redirect code I might need? thanks, Ari

Link to comment
Share on other sites

Hello and thanks for the contribution..

I am using osCommerce MS-2.2

on a Lynix server (all patches up to date)

Ihave installed at least 20 contributions with no problems

 

I installed as per instructions..

no glitches to program with it off..

1] but its not working. when i turn it on

the site works...but when i click a link it seems to be redirecting to a page that is not there and the 404 is redirecting to the root page

 

I figured the problem was with Linux

 

2] I was not sure what you mean by

Linux based server capable of mod_rewrite

 

3] I was not sure if i shoud l re write to match over all the text and not include the tables etc..

on the file..

html_output.php:

It was not the same as mine

 

I eddited the files and uploaded along wiht the 2 additional files

any ideas??

 

TIA

Link to comment
Share on other sites

Hello and thanks for the contribution..

I am using osCommerce MS-2.2

on a Lynix server (all patches up to date)

Ihave installed at least 20 contributions with no problems

 

I installed as per instructions..

no glitches to program with it off..

1] but its not working. when i turn it on

the site works...but when i click a link it seems to be redirecting to a page that is not there and the 404 is redirecting to the root page

 

I figured the problem was with Linux

 

2] I was not sure what you mean by

Linux based server capable of mod_rewrite

 

3] I was not sure if i shoud l re write to match over all the text and not include the tables etc..

on the file..

html_output.php:

It was not the same as mine

 

I eddited the files and uploaded along wiht the 2 additional files

any ideas??

 

TIA

 

Nevermind.. posted the .htaccess files info to stylesheet.css

works now..

Link to comment
Share on other sites

Hi.

First, thanks for this great contrib. I'm having one small problem...

 

When I disable Add category parent to begining of URLs, it doesn't really disable. I still ge the c-## on my links.

I was wondering if there was a fix for this. Thank you.

Link to comment
Share on other sites

Hi!!

 

This contribution is great!! Now my web appears in google, thanks chemo :)

 

I have a question, using Ultimate SEO URLs is possible obtain this url's?

 

www.domain.com/category/subcategory/product+name.html

 

How i can do it??

 

Thanks!!

 

Any can help me please?? :(

Link to comment
Share on other sites

Hi everybody!

 

I actually have a problem with SEO URLs again. Well, I think it might be one ... perhaps I'm also wrong!? :huh:

 

However, some1 will have a second (or a minute ;)) for me ...!? :rolleyes:

 

So, my SEO URls works fine so far: Alle categories + also all products linked in boxes ("new products" or "bestsellers") are OK. Their links point to the html file being converted by mod rewrite. The same for all products listed as a search result.

 

But it doesn't work if I go into a category. Then the links are still shown as product_info.php?...

 

Is this normal? I thought these links also should be transformed like I saw i many other shops and I thought I have seen in my shop before!? But I also can't imagine what I should have done causing this!?

Link to comment
Share on other sites

Hi Dudes !

 

I use this great contribution too.

 

i changed my installation of my Badspiegel Shop from xyz.com/shop to the root directory (xyz.com/).

The problem is, that the old URLs are still reachable. The old URLs are listed at google and I will delete it in the future but if there is no problem to reach the sites with the wrong URL, there is no chance for deleting it. Google will still find the old sites, although I blocked the shop directory in the robots.txt

 

The whole content of the /shop directory is deleted but the SEO Contribution still rewrites the old URLs to the new ones.

 

So if i type : xyz.zzz/shop/product.html

or xyz.shopbangboombang/product.html

or xyz.shcdhvfhsdhfhdhdhj/product.html

 

the original content of url : xyz.zzz/product.html will be shown with the wrong URL that doesn't exists.

 

How can I fix this ? so that only the real files in the root are reachable for google ?

 

greetings from germany

Link to comment
Share on other sites

Hi,

For those who are interested. I found a problem that has been documented on chemos site but I was unaware was affecting my own sites.

Because this contribution uses a different database connection to the rest of osc it is possible for this script to overwrite the internal insert_id (the last auto-increment value added by mysql) if you have persistent connections turned on. On my sites this was causing orders to not show up in the administration because they were entered into the order_status_history table with an order id of 0. This would happen in the rare instance that a page was requested between an order being inserted into the database and that orders status going into the status history table. There are numerous other times when this could happen. If you don?t have much traffic or you don?t use persistent connections there is a good chance that you have got away with it but it is a problem.

Fix?

/includes/functions/database.php

Change:
 function tep_db_insert_id($link = 'db_link') {
return mysql_insert_id();
 }

To:
 function tep_db_insert_id($link = 'db_link') {
  global $$link;
return mysql_insert_id($$link);
 }

 

Hope this helps someone.

Sam

Link to comment
Share on other sites

Hi Dudes !

 

I use this great contribution too.

 

i changed my installation of my Badspiegel Shop from xyz.com/shop to the root directory (xyz.com/).

The problem is, that the old URLs are still reachable. The old URLs are listed at google and I will delete it in the future but if there is no problem to reach the sites with the wrong URL, there is no chance for deleting it. Google will still find the old sites, although I blocked the shop directory in the robots.txt

 

The whole content of the /shop directory is deleted but the SEO Contribution still rewrites the old URLs to the new ones.

 

So if i type : xyz.zzz/shop/product.html

or xyz.shopbangboombang/product.html

or xyz.shcdhvfhsdhfhdhdhj/product.html

 

the original content of url : xyz.zzz/product.html will be shown with the wrong URL that doesn't exists.

 

How can I fix this ? so that only the real files in the root are reachable for google ?

 

greetings from germany

 

 

 

I had this problem, I solved it like this - Overwrite the need_redirect function with this...

 

/includes/classes/seo.class.php

	function need_redirect(){
	if ( is_numeric(strpos($this->real_uri, '{')) ){
		$this->need_redirect = false;
	} else {
		foreach( $this->reg_anchors as $param => $value){
			$pattern[] = $param;
			$arAnchorValues[] = $value;
		}
	$this->uri != $this->real_uri 
		?	$this->need_redirect = false
		:	eregi("(cName|pName|mName)", $this->uri) 
				?	$this->attributes['SEO_REWRITE_TYPE'] != 'cName' 
					?	$this->need_redirect = true 
					:	$this->need_redirect = false 
				:	eregi("(".implode('|', $pattern).")", $this->uri) 
					?	$this->need_redirect = true
					:	$this->need_redirect = false;
	}

	$arRealUriParts = parse_url($this->real_uri);
	$strGeneratedLink = $this->href_link(basename($arRealUriParts['path']), $arRealUriParts['query'],(strtolower($arRealUriParts['scheme']) === 'https') ? 'SSL' : 'NONSSL');

	if(is_array($arAnchorValues)) {
		if(eregi("(".implode('|', $arAnchorValues).")", $this->uri) && $this->uri != basename($strGeneratedLink)) {
			$this->need_redirect = true;
			$this->uri_parsed =  $arRealUriParts;

		}
	}
} # end function set_seopage

 

Sam

Link to comment
Share on other sites

I'm wondering how people here deal with situation that occurs when you change the name of a product.

 

When the product's name is changed, so does the url. This means that there will be 2 versions of the same page out there in Search Engine land for a while.

 

I am trying to put a permanent redirect in my htaccess file, such as

Redirect permanent /big-blue-p-118.html http://www.mydomain.co.uk/pink-blue-big-p-118.html

 

This in theory should work (shoudln't it!?) but what returns is

http://www.mydomain.co.uk/pink-blue-big-p-118.html?products_id=74

This is what I want except for the ?products_id=74 at the end!

 

Has anyone got an ideas of why it's dealing with it in this way? The htaccess file is below. Hope someone can help!

 

php_value register_globals 1


Options +FollowSymLinks
RewriteEngine On


RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}


########Redirecting Old SEO enabled URLs#########
Redirect permanent /big-blue-p-118.html http://www.mydomain.co.uk/pink-blue-big-p-118.html

Link to comment
Share on other sites

In addplication_top.php find this code:

// Ultimate SEO URLs v2.1
include_once(DIR_WS_CLASSES . 'seo.class.php');
if ( !is_object($seo_urls) ){
	$seo_urls = new SEO_URL($languages_id);
}

and UNDER it paste this code:

//// Redirect code for changing product names
// 10 January 2006, Bobby Easland
// Run a regex to see if there are matches
preg_match_all("/(.*)-p-(.*)\.html/", trim($_SERVER['REQUEST_URI'], '/'), $matches, PREG_PATTERN_ORDER);
if ( sizeof($matches) > 0 ){ // a match was found
	// remove the -'s and convert to upper case
	$uri_name = $matches[1][0];
	// get the products ID and case as integer
	$products_id = (int)$matches[2][0];
	if ( defined('PRODUCT_NAME_' . $products_id) ){
		// defined name
		$defined_name = seo_urls->short_name(constant('PRODUCT_NAME_' . $products_id));
		// if they don't match let's redirect
		if ($products_id != 0 && $uri_name != $defined_name){
			$url = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id, 'NONSSL', false);			
			header("HTTP/1.0 301 Moved Permanently"); // send the 301, moved permanently header
			// close session (store variables)
			tep_session_close();
			header ("Location: " . $url); // redirect...bye bye
		} # end if 
	} # end if
} # end if

It's not tested but should get you most of the way there...

Link to comment
Share on other sites

Has anyone got an ideas of why it's dealing with it in this way? The htaccess file is below. Hope someone can help!

 

Thats what that need_redirect alteration above does, thats why i modified it. It will 301 redirect if the link generated by the seo class doesn't match the link requested.

Edited by Nimmit
Link to comment
Share on other sites

I have just added your Ultimate_SEO_URLs_v2-2.1e contribution and wondered if you can help me out I have a problem with the BUY NOW button and the ADD TO CART on the product review page.

 

Link from Buy Now Button

 

http://www.bluesatsuma.co.uk/catalog/dogtoys-c-22.html?products_id=34&action=buy_now&sort=2a&osCsid=aa43fc88fe8f7c95d39f678c81081682

 

Resulting link which has added & in the link. When I remove the amp; and use & the link works fine.

 

http://www.bluesatsuma.co.uk/catalog/dogtoys-c-22.html?sort=2a&osCsid=aa43fc88fe8f7c95d39f678c81081682

 

I have added other contributions prior to Ultimate SEO

easy_populate_v2_76b_1

UK Based osCommerce 2.2

 

hope you can help

 

Regards Andy

Edited by blueSatsuma
Link to comment
Share on other sites

I have just added your Ultimate_SEO_URLs_v2-2.1e contribution and wondered if you can help me out I have a problem with the BUY NOW button and the ADD TO CART on the product review page.

the result is an empty shopping basket.

 

Link from Buy Now Button

 

http://www.bluesatsuma.co.uk/catalog/dogtoys-c-22.html?products_id=34&action=buy_now&sort=2a&osCsid=aa43fc88fe8f7c95d39f678c81081682

 

Resulting link which has added

&

in the link. When I remove the amp; and use & the link works fine.

 

http://www.bluesatsuma.co.uk/catalog/dogtoys-c-22.html?sort=2a&osCsid=aa43fc88fe8f7c95d39f678c81081682

 

I have added other contributions prior to Ultimate SEO

easy_populate_v2_76b_1

UK Based osCommerce 2.2

 

hope you can help

 

Regards Andy

Link to comment
Share on other sites

There is an option under the SEO URLs configuration settings that toggles whether or not to output W3C valid URLs. Turn this setting off (false) and the links should work again.

Link to comment
Share on other sites

There is an option under the SEO URLs configuration settings that toggles whether or not to output W3C valid URLs. Turn this setting off (false) and the links should work again.

 

Hi not sure which one to change to false. here are my SEO settings

 

SEO URLs

 

Title Value Action

Enable SEO URLs? true

Add cPath to product URLs? false

Add category parent to begining of URLs? false

Filter Short Words 3

Enable SEO cache to save queries? true

Enable product cache? true

Enable categories cache? true

Enable manufacturers cache? true

Enable articles cache? true

Enable topics cache? true

Enable information cache? true

Enable automatic redirects? false

Choose URL Rewrite Type Rewrite

Enter special character conversions

Remove all non-alphanumeric characters? false

Reset SEO URLs Cache false

Link to comment
Share on other sites

Hi all!

 

First (its getting old, i know), many thumbsup for Chemo's Ultimate SEO URLs! I'll be sure to paypal you ;)

 

Second, I have a little problem. Everything works like a charm except for the Manufacturers list. It doesn't work correctly. The items on the list are redirected to the advandced search.php wich then tells me i have to at least specify one fiels in the form.

 

This is a link produced by the list:

 

http://www.mysite.coml/catalog/advanced_se...facturers_id=19

 

I've tried to use the rewritten link like this:

 

http://www.mysite.com/index.php?mName=samsung

 

This also doesn't work. It just refresses the index.php. I've looked trough the forum and found the solution for that. But here another problem rises: I'm using the Ultimate SEO URLs version 2.0c. This is because i'm hosted on an IIS Windows. And the manual said that this was the latest version that supported de IIS rewrite. So the option to "Enable automated redirect?" is not there.

 

So, two problems. Wich may or may not connect to eachother, i don't now. Who can help me? I will post codes if needed, but as for now i do not have a clue where to find the faulty code.

 

Hope you can help!

 

Dustin

Link to comment
Share on other sites

I updated my Contrib to version 2.1e now. Now URLs for all products named like

 

Part1-Part2

 

are changed to

 

part1part2-p-x.html

 

(while x ist the products number ...)

 

So - where can I change this? I want the '-' also be shown in my URLs ...

 

Does anyone know? (I know I changed that already in my already version ... but maybe I'm too stupid to find the place now!? I don't know ...;))

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