Jump to content
spidometrs

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

Recommended Posts

Hello,

 

I've installed Ultimate SEO and it seems to run fine w/o any real 'bugs' although I do have a slight issue that is more of an annoyance than anything else.

 

Nearly every product in my store is in at least 10 different categories (auto parts store.) My issue is that the breadcrumb on the product's info page always seems to default to the category that the product was first added to and not the category the customer came from. For example:

 

Customer is in 2_7_23_60_417_666 and clicks on a product.

 

That specific product was first added to 2_4_19_238_652, and when the customer clicks on the product from 2_7_23_60_417_666 the breadcrumb shows up as 2_4_19_238_652. This isnt really an issue to me persay, but I've have had enough customers call with confusion to justify turning SEO off until I get this resolved. I think I'm going to end up just turning off the breadcrumb if I cannot get this straight.

 

 

anyone have an idea dunno.gif

Share this post


Link to post
Share on other sites
Sorry, it wasn't good solution. But now I know the answer :D.

To fix links to pages in category, product listing (TeaBag have this problem, so Do I) which is bug in Ultimate Seo Urls you must change something in file seo.class.php (includes/classes).

 

Find function function Validatename($url, $type, $realID, $connection, $separator) (1036 line) and change two lines (comments them), like that :

// header("HTTP/1.0 301 Moved Permanently");

// header("Location: $link");

 

And now it's GOOD.

 

Thank you this solves the pages problem..... :lol:

Share this post


Link to post
Share on other sites

I tried installing this contribution but now get the following error message when I try to access my admin area:

 

Warning: main(includes/classes/seo.class.php) [function.main]: failed to open stream: No such file or directory in /home/bridalpe/public_html/admin/includes/application_top.php on line 132

 

Warning: main() [function.include]: Failed opening 'includes/classes/seo.class.php' for inclusion (include_path='.:/usr/lib/php') in /home/bridalpe/public_html/admin/includes/application_top.php on line 132

 

Fatal error: Class 'SEO_URL' not found in /home/bridalpe/public_html/admin/includes/application_top.php on line 134

 

Any idea what I could have done wrong? I can't access the admin area now, so I need to get this fixes ASAP. Any help would be appreciated.

 

Thanks

Share this post


Link to post
Share on other sites
I tried installing this contribution but now get the following error message when I try to access my admin area:

Any idea what I could have done wrong? I can't access the admin area now, so I need to get this fixes ASAP. Any help would be appreciated.

 

Thanks

 

 

Be sure that you have uploaded seo.class.php to the includes/classes directory along with the file reset_seo_cache.php to the admin/includes/classes directory

Share this post


Link to post
Share on other sites
Be sure that you have uploaded seo.class.php to the includes/classes directory along with the file reset_seo_cache.php to the admin/includes/classes directory

 

I definitely uploaded both files. I even set the permission to 777 to see if that would make a difference, but no luck.

 

I'm pretty sure I followed all the steps exactly as described...the only thing I'm not sure about is the .htaccess file. I uploaded it with a .htaccess.txt filename and renamed it .htaccess after the upload. I don't see the file anymore, so I don't know if it disappeared or if it is considered a hidden file. Could this have anything to do with it?

Share this post


Link to post
Share on other sites
I definitely uploaded both files. I even set the permission to 777 to see if that would make a difference, but no luck.

 

I'm pretty sure I followed all the steps exactly as described...the only thing I'm not sure about is the .htaccess file. I uploaded it with a .htaccess.txt filename and renamed it .htaccess after the upload. I don't see the file anymore, so I don't know if it disappeared or if it is considered a hidden file. Could this have anything to do with it?

 

you did not have to open it as TXT file. you were suppose to open it as is with and PHP editor. so delete that file and follow me. it should work. mine is working 100% fine

Share this post


Link to post
Share on other sites

Any chance to use this contribution with register globals off? my server does not accept to change to on for security reasons. Is it possible to use this contributions with out register globals on using i.eg. register globals contribution?

Share this post


Link to post
Share on other sites
you did not have to open it as TXT file. you were suppose to open it as is with and PHP editor. so delete that file and follow me. it should work. mine is working 100% fine

 

So I created the .htaccess file with a PHP editor and now I get the following error:

 

500 - Internal Server Error

The server encountered a problem while trying to fulfill your request. Please try again later.

If the error persists, please contact the website webmaster.

If you are the webmaster of this site please log in to Cpanel and check the Error Logs. You will find the exact reason for this error there.

 

Common reasons for this error are:

 

Incorrect file/directory permissions: 766 or 777.

The webserver does not process php/cgi scripts with higher permissions than 755. Change the permissions of your file/directory to 755 in order to solve this issue.

 

Incorrect Apache directives inside .htaccess file.

In case custom Apache directives have been added to the .htaccess file, the Internal Server Error means these directives are either not supported and should be removed or are incorrect and should be re-written.

 

Php directives set in the .htaccess file instead of the php.ini files.

All custom php settings (e.g. php_flag) must be placed inside a php.ini file. For each separate directory you should create its own php.ini file.

 

I checked the permissions on the "admin" folder and it is set to 755. The .htaccess file is still not visible in my file manager.

 

Any thoughts?

 

Thanks for your help.

Share this post


Link to post
Share on other sites

Hi,

 

I've seen a couple of older posts on a similar topic, but nobody seems to have posted a solution yet. I'm trying to display the manufacturer, along with the product name on the product_info.php pages.

 

So, the URL would read: /manufacturer-productname-p-123.html?...

 

I think I've narrowed it down to the parse_parameters function in seo.class.php, but can find a way to call the make_url function which includes both product and manufacturer info.

 

A snippet of relevant code pasted below, to show you what I mean...

 

function parse_parameters($page, $params, &$separator){
$p = @explode('&', $params);
krsort($p);
$container = array();
foreach ($p as $index => $valuepair){
$p2 = @explode('=', $valuepair); 
switch ($p2[0]){ 
	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);
							$this->ValidateName($url, "p", $p2[1], $connection, $separator);
		break;
		case ( $page == FILENAME_PRODUCT_REVIEWS ):
				$url = $this->make_url($page, $this->get_product_name($p2[1]), 'products_id_review', $p2[1], '.html', $separator);
							$this->ValidateName($url, "pr", $p2[1], $connection, $separator);
		break;
		case ( $page == FILENAME_PRODUCT_REVIEWS_INFO ):
			$url = $this->make_url($page, $this->get_product_name($p2[1]), 'products_id_review_info', $p2[1], '.html', $separator);
							$this->ValidateName($url, "pw", $p2[1], $connection, $separator);
		break;
		default:
			   $container[$p2[0]] = $p2[1];
		break;
				} # end switch
	break;
	case 'cPath':
	switch(true){
		case ($page == FILENAME_DEFAULT):
			$url = $this->make_url($page, $this->get_category_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
							$this->ValidateName($url, "c", $p2[1], $connection, $separator);
			break;
		case ( !$this->is_product_string($params) ):
			if ( $this->attributes['SEO_ADD_CPATH_TO_PRODUCT_URLS'] == 'true' ){
			$container[$p2[0]] = $p2[1];
				}
		break;
		default:
			$container[$p2[0]] = $p2[1];
		break;
					} # end switch
	break;
		case 'manufacturers_id':
	switch(true){
		case ($page == FILENAME_DEFAULT && !$this->is_cPath_string($params) && !$this->is_product_string($params) ):
			 	$url = $this->make_url($page, $this->get_manufacturer_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
							$this->ValidateName($url, "m", $p2[1], $connection, $separator);
		break;
		case ($page == FILENAME_PRODUCT_INFO):
		break;
		default:
			$container[$p2[0]] = $p2[1];
		break;
			} # end switch
	break;

 

Any suggestions would be very welcome.

 

Thanks.

Share this post


Link to post
Share on other sites

I installed the contribution on a new oscommerce version (downloaded today). With a slight mod to the seo.class.php file, it works great.

 

One problem - using frontpage to work with files and it needs .htaccess to function. Frontpage won't work if you add the seo rules to .htaccess where the frontpage settings are located. Any ideas for a fix?

 

Thanks in advance.

 

Steve

Share this post


Link to post
Share on other sites
I installed the contribution on a new oscommerce version (downloaded today). With a slight mod to the seo.class.php file, it works great.

 

One problem - using frontpage to work with files and it needs .htaccess to function. Frontpage won't work if you add the seo rules to .htaccess where the frontpage settings are located. Any ideas for a fix?

 

Thanks in advance.

 

Steve

You can use notepad as editor...

Share this post


Link to post
Share on other sites

i tried ultimate SEO URL, but i realized its missing an important feature about mulilangual site.

 

originally OSC manage language switching by appending ?language=fr to the URL.

once selected a language, it stores the value in the session, so the urls will look 'clean' again

 

the result of this?

index for french will have exactly the same url as index for english.

 

in my idea of seo , there should be also a rewriting of language url, perhaps making it:

/fr/index.php and /en/index.php

 

I am actually doing it already, but i would like to ask your expert opinion:

to make the site work, i will change my links to the template "/lang/page.php"

in htaccess, i will create the rule:

redirect condition /fr/page.php

rule page.php?language=fr

 

this will work, fine.

now the problem would be that google already indexed a lot of old urls including the LANGUAGE parameter.

so as usual i would use a 301 to redirect old urls to the new ones.

so:

rule redirect condition page.php?language=fr

rule /fr/page.php [301]

 

the result of is will be:

 

rule redirect condition page.php?language=fr

rule /fr/page.php [301]

redirect condition /fr/page.php

rule page.php?language=fr

 

with apache redirecting back and forward to 2 urls.

i am not really sure whether google will appreciate this or not!

any one got better suggestion?

 

i tried all others SEO contrinution, but i couldnt find anyone good.

please advice.

thanks


Expresionario.com | Pura Sub-cultura!

Share this post


Link to post
Share on other sites

I looked at the cache SQL table created by this contribution. MySQL shows me:

 

 

PRIMARY and INDEX keys should not both be set for column `cache_id`

 

as a warning. Is this something to worry about?

 

Also, how often should we reset cache in admin panel? What does this do?

 

Thank in advance.

Steve

Edited by metricbikes

Share this post


Link to post
Share on other sites

Is it possible to hide the SID / osCID from product links using Ultimate SEO URLs?

It only shows up one time before session being stored in mysql, but I'm using XML exports and it would be nice if the product links in these does not contain ID's.

Share this post


Link to post
Share on other sites

Hi, unfortunately i can't use the contribution due to .htacces mode set to off.... so i have to remove it.

I've cleaned all the files but now as i click on a product i got

Fatal error: Call to undefined function: tep_get_manufacturers_name() in /home/www.mywebsite.com/htdocs/catalog/product_info.php on line 97

 

Does anyone know on how to solve this matter?

Thanks a lot...

Share this post


Link to post
Share on other sites

Hi there, not sure if anyone can help but here goes - I do have the contribution working fully.

 

For some reason when I click on a product it does not display the products parent / sub category, how can I change this so it displays the following:

 

 

www.test.com/catalog/category/product-name.html .. basically like the Search Enginge Friendly contribution (not using it as I have had problems adding products to cart)

 

 

Also how can I get rid of the 'c-49' and 'p-23' etc , e.g.

 

http://www.test.co.uk/catalog/gold-ring-p-49.html

 

 

Any help appreciated,

 

Thanks

Share this post


Link to post
Share on other sites
Hi there, not sure if anyone can help but here goes - I do have the contribution working fully.

 

For some reason when I click on a product it does not display the products parent / sub category, how can I change this so it displays the following:

www.test.com/catalog/category/product-name.html .. basically like the Search Enginge Friendly contribution (not using it as I have had problems adding products to cart)

Also how can I get rid of the 'c-49' and 'p-23' etc , e.g.

 

http://www.test.co.uk/catalog/gold-ring-p-49.html

Any help appreciated,

 

Thanks

 

 

Short answer change seo url contrib.... Ultimate seo urls uses the c- and p- numbers as identifiers so you can't just remove them and retain the functionality of the contrib....

 

Since you have already looked at Search Engine Friendly Urls, you might have a look at SEO-G instead

Edited by toyicebear

Share this post


Link to post
Share on other sites

Hello All,

 

Is it possible to add apache rewrite rules to .htaccess file? I tried to add another string to rewrite into a SEO url to .htaccess but did not work. Can anyone explain the steps to add rewrite rules?

 

Thanks in advance.

Randy

Edited by hitechredneck

Share this post


Link to post
Share on other sites

I found this post on a different SEO thread and it works perfectly to fix the paging problem with category pages, can someone help me adapt it for manufacturer pages?

 

QUOTE(yeahyeahyeah @ Aug 2 2005, 02:41 PM)

is there a way to incorporate ?page= into the URL when paginating a category's products?

 

if this has already been addressed and i missed it, can someone point out where?

 

thanks!

 

 

 

 

i jury rigged a fix. i'm thinking this can be done in the seo class, but i did it in includes/classes/split_page_results.php

if the other class is a better way, any help working this is appreciated.

 

i replaced

 

var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;

 

with

 

var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name, $dummy;

 

then

 

if (isset($HTTP_GET_VARS[$page_holder])) {        $page = $HTTP_GET_VARS[$page_holder];      } elseif (isset($HTTP_POST_VARS[$page_holder])) {        $page = $HTTP_POST_VARS[$page_holder];      } else {        $page = '';      }

 

with

 

preg_match("/(-c-).*\.html/",$_SERVER['REQUEST_URI'],$this->dummy);      if($this->dummy[1]!=NULL) {//yeahyeahyeah. if we're on a category page do this      preg_match("/-pp-(\d*)\.html/",$_SERVER['REQUEST_URI'],$matches);      $page = $matches[1];     }     else {//any other page with splits      if (isset($HTTP_GET_VARS[$page_holder])) {        $page = $HTTP_GET_VARS[$page_holder];      } elseif (isset($HTTP_POST_VARS[$page_holder])) {        $page = $HTTP_POST_VARS[$page_holder];      } else {        $page = '';      }     }

 

then

 

return $display_links_string;

 

with

 

if($this->dummy[1]!=NULL)//yeahyeahyeah. if we're on a category page do this      $display_links_string=preg_replace("/(-pp-\d*)?\.html\?page=(\d*)/","-pp-$2.html",$display_links_string);//attempt to rewrite using regex     return $display_links_string;

 

 

category page pagination will now look like baby-burp-cloths-ribbon-only-c-21_37-pp-2.html

 

instead of baby-burp-cloths-ribbon-only-c-21_37.html?page=2


rkoechel2004

Share this post


Link to post
Share on other sites

Chemo and everybody involved should be applauded for the Ultimate SEO URLs contribution. It’s perfect for my application. I just added the contribution and moved my site to the root directory. Unfortunately, I have an issue that I need help with.

 

I used the osCommerce application that my ISP provided and it loaded to the /osCommerce/catalog directory that is generated at install. I moved the store from MyStore/osCommerce/catalog to MyStore/. Then I changed both configure.php files to reflect the move.

 

The vDeck admin console they provide points to MyStore/osCommerce/catalog/admin. So I just typed in MyStore/admin and the new vDeck came up. So I assume that the changes to the admin/includes/configure.php file are good. I had to reset the permissions on several folders and the 2 header_tags.php files, but so far so good.

 

The problem comes in when I go to my site, I get this fatal error message.

 

Fatal error: Call to undefined function: tep_href_link() in /home/MyStore/public_html/includes/application_top.php on line 485

 

From my application_top.php: (line 485 is the last line)

 

// include the breadcrumb class and start the breadcrumb trail
 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;

 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); 

 

What have I overlooked? What should I do to define the function? What’s the next logical step to fix the issue?

 

I have attached the includes/configure.php file below.

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'https://stxx.startlogic.com');		
 define('HTTPS_SERVER', 'https://stxx.startlogic.com');
 define('ENABLE_SSL', true);			// secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'mystore.com');
 define('HTTPS_COOKIE_DOMAIN', 'st08.startlogic.com/~mystore');
 define('HTTP_COOKIE_PATH', '/~mystore/');
 define('HTTPS_COOKIE_PATH', '/~mystore/');
 define('DIR_WS_HTTP_CATALOG', '/~mystore/');
 define('DIR_WS_HTTPS_CATALOG', '/~mystore/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/mystore/public_html/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

// define our database connection
 define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'mystore_p_os3');
 define('DB_SERVER_PASSWORD', 'mypassword');
 define('DB_DATABASE', 'mystore_p_os3');
 define('USE_PCONNECT', 'false'); // use persistent connections?
 define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'
?>

 

Any help would be much appreciated.


"Artificial intelligence is no match for natural stupidity"

Share this post


Link to post
Share on other sites
I had the same problem and while surfing this thread (all 100 pages of it)... i saw many more had the same problem..

 

I found a solution(worked for me)..

 

I forced the use of cookies...

 

Admin -> Session -> Force Cookie Use True

This made sure that the oscid did not show up in the URL, which meant that Ultimate SEO (big thanks Chemo) did it's thing perfectly... even the first time..

If it does work for anybody else.. do post here...

Cheers..

Jack

Jack,

I was having the same problem and tried your solution. It works (removes the osCsid#) but when you try to add something to the shopping cart, you get this madate to set the cookie level to Medium. The instructions are very clear, but even after changing the setting to Medium, you continue be blocked by this warning. you are never taken to the cart even after setting the level to Medium.

Did you ever figure this out?

Carol Ann

Share this post


Link to post
Share on other sites
Jack,

I was having the same problem and tried your solution. It works (removes the osCsid#) but when you try to add something to the shopping cart, you get this madate to set the cookie level to Medium. The instructions are very clear, but even after changing the setting to Medium, you continue be blocked by this warning. you are never taken to the cart even after setting the level to Medium.

Did you ever figure this out?

Carol Ann

 

 

Sent you a PM..

 

 

Cheers..


Converge

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

×