Jump to content
spidometrs

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

Recommended Posts

I'd like to see the back of the '&osCid' in the URL link - Google has indexed the session id a few times and as you can imagine that has caused issues

Now, the obvious thing here is the session id's... that is why you are having the session id's google problems.

 

After i clicked the links in your post above, the pages opened blank but once i deleted the session id from the URL the page displayed.

 

If you have not updated your store to the 2005 and then 2006 osC updates (fix), then you should do so as they are security patches including a session id's patch in the november 2005 update.

 

After that, your listing will show up correctly in search engines without the session id's being cached


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
Now, the obvious thing here is the session id's... that is why you are having the session id's google problems.

 

After i clicked the links in your post above, the pages opened blank but once i deleted the session id from the URL the page displayed.

 

If you have not updated your store to the 2005 and then 2006 osC updates (fix), then you should do so as they are security patches including a session id's patch in the november 2005 update.

 

After that, your listing will show up correctly in search engines without the session id's being cached

 

Are you suggesting reinstalling OSC from scratch to cure this problem or is there some code I can add to my current php files to 'patch' the problem? - I'd rather not have to reinstall from scratch if that's at all possible.

 

Thanks,


Best regs,

Simon.

Share this post


Link to post
Share on other sites

Add it to your cart and you'll see that both the link back to Appleberry Card in the cart at left and on shopping cart php points to http://www.botanicfanatic.com/product_info...ucts_id=28{1}14 not the SEO friendly url

you could fix that by using tep_get_prid() in the function that writes the seo urls for products

i tried but could not get it to work in application top and then functions/general too, which one is the place to apply it?

It doesn't matter functionally, or for the search engines (who should never see it), but fixing it makes the urls consistent for the visitor.

 

As far as I've tested it, this fixes it.

 

In [catalog/]includes/classes/seo.class.php, in the parse_parameters function, look for:

				case 'products_id':
				switch(true){
					case ( $page == FILENAME_PRODUCT_INFO && !$this->is_attribute_string($p2[1]) ):
						$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
						break;

And add the case for products with attributes, like this:

				case 'products_id':
				switch(true){
					case ( $page == FILENAME_PRODUCT_INFO && $this->is_attribute_string($p2[1]) ):
						$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], tep_get_prid($p2[1]), '.html', $separator);
						break;
					case ( $page == FILENAME_PRODUCT_INFO && !$this->is_attribute_string($p2[1]) ):
						$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
						break;

 

Disclaimer: Use at your own risk. Be sure to backup before making changes. :D

 

Cheers!

-Skittles

Share this post


Link to post
Share on other sites
Are you suggesting reinstalling OSC from scratch to cure this problem or is there some code I can add to my current php files to 'patch' the problem? - I'd rather not have to reinstall from scratch if that's at all possible.

 

Thanks,

go to the downloads section and download the 2005 and 2006 updates, add them to your store and see if you get rid of the session id's before reposting here - if that doesn't work im sure you will be advised appropriately on the next step :thumbsup:


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
go to the downloads section and download the 2005 and 2006 updates, add them to your store and see if you get rid of the session id's before reposting here - if that doesn't work im sure you will be advised appropriately on the next step :thumbsup:

 

I can't seem to find the files that you refer to? Can you post me a link?

 

Thanks, Si.


Best regs,

Simon.

Share this post


Link to post
Share on other sites
I can't seem to find the files that you refer to? Can you post me a link?.

It is really hard not to miss it, where have you searched?

 

It would have been quicker for you to have run a search engine query than post here amd wait for a reply.

 

On any oscommrece page (even the one you are on now) go to the 'solutions' link in the navigation bar and select 'downloads' from the droplink


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
It is really hard not to miss it, where have you searched?

 

It would have been quicker for you to have run a search engine query than post here amd wait for a reply.

 

On any oscommrece page (even the one you are on now) go to the 'solutions' link in the navigation bar and select 'downloads' from the droplink

 

I did find the 'complete' OSC package that you refer to but as I said previously I don't want to do a complete install if this can be avoided. :blink:

 

Best regs, Si.

Happy New year!


Best regs,

Simon.

Share this post


Link to post
Share on other sites
I did find the 'complete' OSC package that you refer to but as I said previously I don't want to do a complete install if this can be avoided. :blink:

 

Best regs, Si.

Happy New year!

Well you can still use the same link to download the november 2005 patch, just the patch - not the whole osc store. Thats a start.

 

Happy New Year To All


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

Hi,

 

Great contribution and the instrustions are excellent also.

I just installed it with out a hitch, or so i thought..

 

I did have to merge the categories file as it conflicted with my header tags installation but no biggie.

 

My problem is when i turn the contribution on, and click a link i my catalog i.e jackets the url shows up perfectly but i am redirected to the home page..

 

Every product i click does this, keeps bringing me to the home page even thought the url is fine..

 

Any ideas on what went wrong? Do you think it was the merging of two files?

 

Im pretty sure its something small as usual but have no idea what..

 

Would appreciate a point in the right direction.

 

 

Thanks again for a great contribution.

 

Lee.

Share this post


Link to post
Share on other sites
OK I double checked the categories file to see if this was the problem. Its not.

 

Now Im stumped..

 

Anyone?

Grimmyfrombar,

 

What does your .htaccess file look like?

 

-Skittles

Share this post


Link to post
Share on other sites
Do you want me to pm it to you? I added the extra code as instructed, do you think the problem might be there?

 

thanks,

 

Lee.

Lee,

 

It seems odd that the pages are being redirected to the home page. The first place I would look is in the htaccess file as "the url shows up perfectly".

 

You can PM me if you like, or just hit reply and then paste the contents of the file into the post. (Click on the # button above, paste your code, then click on the # button again. This will make sense when you are actually writing your reply...)

 

-Skittles

Share this post


Link to post
Share on other sites
Lee,

 

It seems odd that the pages are being redirected to the home page. The first place I would look is in the htaccess file as "the url shows up perfectly".

 

You can PM me if you like, or just hit reply and then paste the contents of the file into the post. (Click on the # button above, paste your code, then click on the # button again. This will make sense when you are actually writing your reply...)

 

-Skittles

 

Hi Anita,

 

I feel kinda silly, I was using the .htaccess file in the root and not in the catalog as instructed, it all works fine now. Sorry if i wasted your time. I should know better.

 

Here is one of my urls: /catalog/rings-skull-rings-c-102_103.html does it look ok to you?

 

What by the way does the ending -c-102_103.html mean? and is there awa to remove it?

 

Thanks,

 

Lee.

Share this post


Link to post
Share on other sites
Hi Anita,

 

I feel kinda silly, I was using the .htaccess file in the root and not in the catalog as instructed, it all works fine now. Sorry if i wasted your time. I should know better.

 

Here is one of my urls: /catalog/rings-skull-rings-c-102_103.html does it look ok to you?

 

What by the way does the ending -c-102_103.html mean? and is there awa to remove it?

 

Thanks,

 

Lee.

Lee,

 

No problem. It's never a waste of time to develop relationships within the community.

 

And I'm sure there isn't one person on this forum who doesn't have one of those "silly feeling" ( :blush: ) moments. Me, I've had many!

 

There is no way to get rid of the numbers at the end of your URLs. These tell osCommerce what category (-c-) or product (-p-) is being displayed. You can change the way they are displayed, however.

 

(Always be sure and back up any files before making changes, just in case you decide you want to go back.)

 

For example, to change the category URL from

"/catalog/rings-skull-rings-c-102_103.html"

to

"/catalog/rings-skull-rings.c102_103.html"

change the corresponding array element. In seo.class.php, find:

 

	$this->reg_anchors = array('products_id' => '-p-',
						   'cPath' => '-c-',
						   'manufacturers_id' => '-m-',
						   'pID' => '-pi-',
						   'tPath' => '-t-',
						   'articles_id' => '-a-',
						   'products_id_review' => '-pr-',
						   'products_id_review_info' => '-pri-',
						   'info_id' => '-i-'
						   );

And change it like this:

 

	$this->reg_anchors = array('products_id' => '-p-',
						   'cPath' => '.c',
						   'manufacturers_id' => '-m-',
						   'pID' => '-pi-',
						   'tPath' => '-t-',
						   'articles_id' => '-a-',
						   'products_id_review' => '-pr-',
						   'products_id_review_info' => '-pri-',
						   'info_id' => '-i-'
						   );

Then open your .htaccess file and modify the rewrite rule to support the change:

 

RewriteRule ^(.*).c(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

 

Save your changes, of course, then test it.

 

And dare I ask what you're selling? Skull rings... Pirate jewelry, perhaps?

 

-Skittles

Share this post


Link to post
Share on other sites
Lee,

 

No problem. It's never a waste of time to develop relationships within the community.

 

And I'm sure there isn't one person on this forum who doesn't have one of those "silly feeling" ( :blush: ) moments. Me, I've had many!

 

There is no way to get rid of the numbers at the end of your URLs. These tell osCommerce what category (-c-) or product (-p-) is being displayed. You can change the way they are displayed, however.

 

(Always be sure and back up any files before making changes, just in case you decide you want to go back.)

 

For example, to change the category URL from

"/catalog/rings-skull-rings-c-102_103.html"

to

"/catalog/rings-skull-rings.c102_103.html"

change the corresponding array element. In seo.class.php, find:

 

	$this->reg_anchors = array('products_id' => '-p-',
						   'cPath' => '-c-',
						   'manufacturers_id' => '-m-',
						   'pID' => '-pi-',
						   'tPath' => '-t-',
						   'articles_id' => '-a-',
						   'products_id_review' => '-pr-',
						   'products_id_review_info' => '-pri-',
						   'info_id' => '-i-'
						   );

And change it like this:

 

	$this->reg_anchors = array('products_id' => '-p-',
						   'cPath' => '.c',
						   'manufacturers_id' => '-m-',
						   'pID' => '-pi-',
						   'tPath' => '-t-',
						   'articles_id' => '-a-',
						   'products_id_review' => '-pr-',
						   'products_id_review_info' => '-pri-',
						   'info_id' => '-i-'
						   );

Then open your .htaccess file and modify the rewrite rule to support the change:

 

RewriteRule ^(.*).c(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

 

Save your changes, of course, then test it.

 

And dare I ask what you're selling? Skull rings... Pirate jewelry, perhaps?

 

-Skittles

 

 

Hi Skittles,

 

Yes I sell Gothic Leather & Silver, my site is in my profile if you want a look.

 

Anyways thanks again , I will do the changes soon.. Came across one problem today. When I try to run store feeds or fill the header tags I am getting errors.

 

When I ran the header tags I got the following error:

 

"Warning: chmod() [function.chmod]: Operation not permitted in /home/leather/public_html/catalog/admin/includes/functions/header_tags.php on line 254

Cannot change the mode of file (/home/leather/public_html/catalog/includes/languages/english/header_tags.php)"

 

The chmod setting are fine so, im not sure what the problem is..

 

Or maybe it has nothing to do with this contribution?

 

Thanks again,

 

Lee.

Share this post


Link to post
Share on other sites
Hi Skittles,

 

Yes I sell Gothic Leather & Silver, my site is in my profile if you want a look.

 

Anyways thanks again , I will do the changes soon.. Came across one problem today. When I try to run store feeds or fill the header tags I am getting errors.

 

When I ran the header tags I got the following error:

 

"Warning: chmod() [function.chmod]: Operation not permitted in /home/leather/public_html/catalog/admin/includes/functions/header_tags.php on line 254

Cannot change the mode of file (/home/leather/public_html/catalog/includes/languages/english/header_tags.php)"

 

The chmod setting are fine so, im not sure what the problem is..

 

Or maybe it has nothing to do with this contribution?

 

Thanks again,

 

Lee.

Lee,

 

Cool looking site! Though, I'm a bit too old for the Goth look myself.

 

Operation not permitted in [admin-path]/functions/header_tags.php on line 254

This error means the header_tags file was unable to change the mode for the catalog's language file for header_tags.php. This would be better addressed in a support thread for header tags controller. Although you may want to ask your web host if you have the capability to change mode from a php script. They may have it disabled as a security measure. It could save you a lot of grief if you ask them first... Even if it use to work, your ISP may have made changes. Better to be sure before you spend time tracking this one down.

 

The "store feeds" is another issue. The php file I use for froogle feeds does not automatically support Ultimate SEO URLs. I'll be making changes to the file I use, but I don't know the origin of the file (froogle.php); I got it from a client's site. I need to modify it to support this contrib before I can install this contrib to her site.

 

If you'd like I can PM you the file, froogle.php, with my changes once I've figured it out. You may be able to use my changes to modify your feed file(s).

 

-Skittles

Share this post


Link to post
Share on other sites

Hi,

 

I guess, its allready been said, that this contribution is one of the best ones, and i thank Chemo and all the rest of developing and posting it.

 

I have a problem that i think is connected to this contrib: when enabling the the "Use Search Engin Safe URLs (still in development)" from Configuration-->My Store page, the cataloge index.php is cut off after the Languages box( only the Box's title is shown, nothing else on the right culomn is shown nor the footer) and there is an "Error! Unable to determin the page link!" notification.

 

Anoter small thing (maybe there is a connection) is that the Enable/disable the "Use Search Engin Safe URLs" for the googlesite map - if its not enabled, the site map will propagate as the cPath URLs and not by the category/product name...

 

attached is a URL for the screengrab of the error:when the SEO in Config->Mystore is enabled

 

Would reeealy appriciate some help...

Many thanks in any case,

Sharon.

Edited by sukarya

Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

Share this post


Link to post
Share on other sites
Hi,

 

I guess, its allready been said, that this contribution is one of the best ones, and i thank Chemo and all the rest of developing and posting it.

 

I have a problem that i think is connected to this contrib: when enabling the the "Use Search Engin Safe URLs (still in development)" from Configuration-->My Store page, the cataloge index.php is cut off after the Languages box( only the Box's title is shown, nothing else on the right culomn is shown nor the footer) and there is an "Error! Unable to determin the page link!" notification.

 

Anoter small thing (maybe there is a connection) is that the Enable/disable the "Use Search Engin Safe URLs" for the googlesite map - if its not enabled, the site map will propagate as the cPath URLs and not by the category/product name...

 

attached is a URL for the screengrab of the error:when the SEO in Config->Mystore is enabled

 

Would reeealy appriciate some help...

Many thanks in any case,

Sharon.

 

 

Just quickly - you should NOT enable "Use search engine safe URLs (still in development)". It should be set to disabled, as this has nothing to do with chemo's contrib, and will break your site.

 

Cheers,

Chris

Share this post


Link to post
Share on other sites
Just quickly - you should NOT enable "Use search engine safe URLs (still in development)". It should be set to disabled, as this has nothing to do with chemo's contrib, and will break your site.

 

Cheers,

Chris

 

 

Thanks Chris.

Any idea what should i do with the Google site map contibution problem (only when this is enabled, the XMl will output the Catgory/product name instaed of the ID...)? <so i wouldnt post it in the Sitemap contrib thread...>

 

p.s.

 

you replied real fast : )


Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

Share this post


Link to post
Share on other sites
Thanks Chris.

Any idea what should i do with the Google site map contibution problem (only when this is enabled, the XMl will output the Catgory/product name instaed of the ID...)? <so i wouldnt post it in the Sitemap contrib thread...>

 

p.s.

 

you replied real fast : )

 

Which Google XML Sitemap are you using?

 

Is SEO URL's now fully working without that other option on?

 

Regards,

Chris

Share this post


Link to post
Share on other sites
Which Google XML Sitemap are you using?

 

Is SEO URL's now fully working without that other option on?

 

Regards,

Chris

 

 

well, working - but not fully: i want to add the cateory to the URL <its enabled in the SEO Admin section>

but its showing only the products.

 

Im using the Google XML Sitemap - Admin 2.1

 

10x,

Sharon


Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

Share this post


Link to post
Share on other sites

hello,

 

i´ve a problem with seo urls and an other contribution named Discount Coupon Codes 2.1

 

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

 

the coupon code put in by costumer is proofed for validness and number of using and the page would be reloaded with an error notification if it´s invalid or the number of using is reached....

 

it´s in the ordering process, so it´s ssl protected.

 

the problem is, when the code is invalit or the numer of using is reched, the page would not be reloaded with that error, instead of the login-page occurs.

 

i found out, that this bug does not appear, if i

 

- turn off the seo url´s in the admin or

- if i turn of SSL protection or

- if i change the redirect with the parameter (which includes the error massage) like this:

 

from:

 

tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_FREE_SHIPPING_ERROR ), 'SSL' ) );

 

to:

 

tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, '', 'SSL' ) );

 

in the last way, the problem is, that the page is reloaded, but the costumer does not get the error massage

 

so my idea is to turn off seo url´s only for that redirection or to reload the page with the discription of the error in another way (but i´m not as firm in php to realize this)

 

please help!

 

thanks a lot!!!

 

 

here the original code in checkout_confirmation.php:

 

if( tep_not_null( $HTTP_POST_VARS['coupon'] ) ) { //if they have entered something in the coupon field

$this_coupon = new discount_coupon( tep_db_prepare_input( $HTTP_POST_VARS['coupon'] ) );

$this_coupon->verify_code();

//print_r( $this_coupon ); //use this to debug coupon object problems

if( !$this_coupon->is_errors() ) { //if we have passed all tests (no error message), make sure we still meet free shipping requirements, if any

if( $this_coupon->is_recalc_shipping() ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode( ENTRY_DISCOUNT_COUPON_FREE_SHIPPING_ERROR ), 'SSL' ) ); //redirect to the shipping page to reselect the shipping method

} else {

if( tep_session_is_registered('coupon') ) { tep_session_unregister('coupon'); //remove the coupon from the session

 

tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode( implode( ' ', $this_coupon->error_message ) ), 'SSL' ) ); //redirect to the payment page

}

}

} else { //if the coupon field is empty, unregister the coupon from the session

if( tep_session_is_registered('coupon') ) tep_session_unregister('coupon');

}

Share this post


Link to post
Share on other sites
well, working - but not fully: i want to add the cateory to the URL <its enabled in the SEO Admin section>

but its showing only the products.

 

Im using the Google XML Sitemap - Admin 2.1

 

10x,

Sharon

 

 

"Showing only the products" - I mean that when clicking on a product link the URL shows the product url - without the Category.


Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

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

×