Jump to content
spidometrs

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

Recommended Posts

We have a few OSC sites running the Simple Template System and have some type of SEO friendly URL solution in place that I'd like to change out for this contribution. Would you be able to walk me through that change Jack? I can send you files to read the code to see how the site is structured.

 

I'm also worried about hurting our SEO after a change like this, will we need 301 redirects in place to help prevent a drop in SEO once the URLs change?

Edited by ludachris

Share this post


Link to post
Share on other sites

You just need to follow the install instructions. The contribution will work with STS. The code will issue 301's but only for url's formatted in one of the stock methods. If you have used some other rewrite contribution that created urls that are different than those created with this one, you may lose some ranking in the search engine listings. In that case, you would need to add redirect code. This is usually not a problem but it is difficult to say without knowing more about the shop. You can install this contribution and test it though. Just be sure to make a backup of your files in case you need to do a restore. And, in that case, be sure to turn this contribution off first.

Share this post


Link to post
Share on other sites

You just need to follow the install instructions. The contribution will work with STS. The code will issue 301's but only for url's formatted in one of the stock methods. If you have used some other rewrite contribution that created urls that are different than those created with this one, you may lose some ranking in the search engine listings. In that case, you would need to add redirect code. This is usually not a problem but it is difficult to say without knowing more about the shop. You can install this contribution and test it though. Just be sure to make a backup of your files in case you need to do a restore. And, in that case, be sure to turn this contribution off first.

I took over these shops and have worked with OSC in the past but am not sure how to identify which rewrite solution they're using. If I PM'd you the URLs of the shops could you take a look and offer your opinion on what they're using and what the best course of action would be? Thanks in advance.

Share this post


Link to post
Share on other sites

I took over these shops and have worked with OSC in the past but am not sure how to identify which rewrite solution they're using. If I PM'd you the URLs of the shops could you take a look and offer your opinion on what they're using and what the best course of action would be? Thanks in advance.

There are too many possibilites to even guess at it by looking at the url.

Share this post


Link to post
Share on other sites

There are too many possibilites to even guess at it by looking at the url.

Yeah, I figured it would be tough. Can I send you any files to look through? You can PM me your contact info.

Share this post


Link to post
Share on other sites

No, I only provide free support on the forums.

Okay... so does that mean I should post file code here in the forums? If so which files should I post the code for? Or should I PM you and get a quote on what you might charge to look through some files to help me figure out what SEO solution our sites are using? Or are you saying I should look elsewhere for help? If you could just give me some options to help me solve my problem so that I might be able to use this contribution I'd appreciate it. If you aren't interested in helping, maybe you can recommend an alternative for me? Edited by ludachris

Share this post


Link to post
Share on other sites

People that offer support here on the forums, including myself, do so in a limited capacity since it is done in their free time. So you may not always get the help you need in the forums alone. You can try posting the file and someone may help you, or may not. If you can't get an answer to your problem, then the only other solution is to pay someone to look at it for you. Many of the people here, though not all, that offer support also offer paid support, myself included. You can post your request in the commercial support forum or PM those you think are qualified to work on your shop.

Share this post


Link to post
Share on other sites

i install the rss feed contribution on osc version 2.3.x and all i get is a page that reads Internet Explorer cannot display the webpage i have the ultimate seo addon install can that be causing the problem if it is how do i get it to display rthe feed

 

thanks

lenard

Share this post


Link to post
Share on other sites

i install the rss feed contribution on osc version 2.3.x and all i get is a page that reads Internet Explorer cannot display the webpage i have the ultimate seo addon install can that be causing the problem if it is how do i get it to display rthe feed

No, it shouldn't. But you can turn it off in admin to see if the problem still occurs.

Share this post


Link to post
Share on other sites

Hi Jack_mcs.

I use seo urls long time (about 2 years) and that old version works good with russian lang.

In this month i change hosting (php v5.3) and now your script not work, because ereg functions is deprecated.

I try to use updated version, but links with russian symbols not build.

I try to correct seo.class.php, but no result.

 

Example here: http://www.argoshka.ru - old good links in the center (written by hand), new - left right column and bottom.

 

Please help.

 

P.S. i am not professional web coder and sorry for bad language)))

Edited by kgtu5

Share this post


Link to post
Share on other sites

Hi Jack_mcs.

I use seo urls long time (about 2 years) and that old version works good with russian lang.

In this month i change hosting (php v5.3) and now your script not work, because ereg functions is deprecated.

I try to use updated version, but links with russian symbols not build.

I try to correct seo.class.php, but no result.

 

Example here: http://www.argoshka.ru - old good links in the center (written by hand), new - left right column and bottom.

 

Please help.

 

P.S. i am not professional web coder and sorry for bad language)))

You could use a program like winmerge and compare the old and new files and just change copy over the ereg calls.

Share this post


Link to post
Share on other sites

Hi,

 

I installed latest version of Ultimate SEO 2-2.2d-12 following the instructions here: http://www.oscommerce.com/community/contributions,2823

 

on Oscommerce - my site is here: http://starepocztowki.waw.pl

(osCommerce Online Merchant v2.3.1)

 

URL rewritting works fine but if I click on the products and the link does not lead me anywhere - product just

do not show up.

I suppose I misunderstood how to modify my existing htacces file but I am not sure if this is the

cause of my problem.

 

my osc shop is in a directory /public_html/starepocztowkiwaw

 

and my current htaccess file looks like this:

 

 

# $Id$

#

# This is used with Apache WebServers

#

# For this to work, you must include the parameter 'Options' to

# the AllowOverride configuration

#

# Example:

#

# <Directory "/usr/local/apache/htdocs">

# AllowOverride Options

# </Directory>

#

# 'All' with also work. (This configuration is in the

# apache/conf/httpd.conf file)

 

# The following makes adjustments to the SSL protocol for Internet

# Explorer browsers

 

#<IfModule mod_setenvif.c>

# <IfDefine SSL>

# SetEnvIf User-Agent ".*MSIE.*" \

# nokeepalive ssl-unclean-shutdown \

# downgrade-1.0 force-response-1.0

# </IfDefine>

#</IfModule>

 

# If Search Engine Friendly URLs do not work, try enabling the

# following Apache configuration parameter

 

# AcceptPathInfo On

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

 

# php_value session.use_trans_sid 0

# php_value register_globals 1

 

##### OSCOMMERCE ADMIN PROTECTION - BEGIN #####

AuthType Basic

AuthName "osCommerce Online Merchant Administration Tool"

AuthUserFile /home4/dugonali/public_html/starepocztowkiwaw/admin/.htpasswd_oscommerce

Require valid-user

##### OSCOMMERCE ADMIN PROTECTION - END #####

 

IF I Change the above to (see below) I just cannot login to my admin panel (and products still do not show up either) ;

 

# Begin Ultimate SEO V2.2d

# For security reasons, Option followsymlinks cannot be overridden.

#Options +FollowSymLinks

Options +SymLinksIfOwnerMatch

RewriteEngine On

 

# RewriteBase instructions

# Change RewriteBase dependent on how your shop is accessed as below.

# http://www.starepocztowki.waw.pl/ = RewriteBase /

# http://www.starepocztowki.waw.pl/starepocztowkiwaw/ = RewriteBase /starepocztowkiwaw/

# http://www.starepocztowki.waw.pl/starepocztowkiwaw/shop/ = RewriteBase /starepocztowkiwaw/shop/

 

# Change the following line using the instructions above

RewriteBase /YOU HAVE TO CHANGE ME/

 

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 ^(.*)-by-(.*).html$ all-products.php?fl=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-au-(.*).html$ articles.php?authors_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 ^(.*)-f-(.*).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-fri-(.*).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-fra-(.*).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}

# End Ultimate SEO V2.2d

 

 

 

In the above htaccess the line says "RewriteBase /YOU HAVE TO CHANGE ME/" and instead "YOU HAVE TO CHANGE ME" I put starepocztowkiwaw where my osc is installed but did not help.

I do not know exactly what to do about "shop" in this line because there is no such a subdirectory in

my installation # http://www.starepocztowki.waw.pl/starepocztowkiwaw/shop/ = RewriteBase /starepocztowkiwaw/shop/

 

Thank you for your helping me to solve the problem.

Share this post


Link to post
Share on other sites

on Oscommerce - my site is here: http://starepocztowki.waw.pl

 

my osc shop is in a directory /public_html/starepocztowkiwaw

 

on Oscommerce - my site is here: http://starepocztowki.waw.pl

 

(In the above htaccess the line says "RewriteBase /YOU HAVE TO CHANGE ME/" and instead "YOU HAVE TO CHANGE ME" I put starepocztowkiwaw where my osc is installed but did not help.

I do not know exactly what to do about "shop" in this line because there is no such a subdirectory in

my installation # http://www.starepocztowki.waw.pl/starepocztowkiwaw/shop/ = RewriteBase /starepocztowkiwaw/shop/

It doesn't matter where the shop is actually stored on the server but what the url to the shop is. Your url doesn't show a sub-directory so the entry should be

RewriteBase /

Share this post


Link to post
Share on other sites

ok! Thank you.

I changed it but my items still do not show up.

Everything worked fine untill Installed Ultimate SEO 2-2.2d-12.I am happy with the result except for the impossibility to see the products ;)

I went to your site, clicked on the first category and then the product in that category and it worked as it should. Maybe your browsers cache needs to be cleared or the cache in the contributions settings.

Share this post


Link to post
Share on other sites

Hi,

 

I just installed the latest version of Ultimate SEO. Everything works great, except when I try to add a new product in the admin I receive this error.

 

1146 - Table 'Product_urbanbasix_com.cache' doesn't exist DELETE FROM cache WHERE cache_name LIKE '%seo_urls%' [TEP STOP]

 

Help would be appreciated.

 

Thanks,

Peter

Share this post


Link to post
Share on other sites

Hi,

 

I just installed the latest version of Ultimate SEO. Everything works great, except when I try to add a new product in the admin I receive this error.

 

1146 - Table 'Product_urbanbasix_com.cache' doesn't exist DELETE FROM cache WHERE cache_name LIKE '%seo_urls%' [TEP STOP]

 

Help would be appreciated.

 

Thanks,

Peter

That can happen where older versions were installed. First try using the uninstall option in the settings in admin for this contribution and then refreshing your shop. If that doesn't do it, then you'll need to run the following using phpmyadmin, or however you edit the database on your server
CREATE TABLE `cache` (
			  `cache_id` varchar(32) NOT NULL default '',
			  `cache_language_id` tinyint(1) NOT NULL default '0',
			  `cache_name` varchar(255) NOT NULL default '',
			  `cache_data` mediumtext NOT NULL,
			  `cache_global` tinyint(1) NOT NULL default '1',
			  `cache_gzip` tinyint(1) NOT NULL default '1',
			  `cache_method` varchar(20) NOT NULL default 'RETURN',
			  `cache_date` datetime NOT NULL,
			  `cache_expires` datetime NOT NULL,
			  PRIMARY KEY  (`cache_id`,`cache_language_id`),
			  KEY `cache_id` (`cache_id`),
			  KEY `cache_language_id` (`cache_language_id`),
			  KEY `cache_global` (`cache_global`)
		    ) ;

Share this post


Link to post
Share on other sites

That can happen where older versions were installed. First try using the uninstall option in the settings in admin for this contribution and then refreshing your shop. If that doesn't do it, then you'll need to run the following using phpmyadmin, or however you edit the database on your server

CREATE TABLE `cache` (
			  `cache_id` varchar(32) NOT NULL default '',
			  `cache_language_id` tinyint(1) NOT NULL default '0',
			  `cache_name` varchar(255) NOT NULL default '',
			  `cache_data` mediumtext NOT NULL,
			  `cache_global` tinyint(1) NOT NULL default '1',
			  `cache_gzip` tinyint(1) NOT NULL default '1',
			  `cache_method` varchar(20) NOT NULL default 'RETURN',
			  `cache_date` datetime NOT NULL,
			  `cache_expires` datetime NOT NULL,
			  PRIMARY KEY  (`cache_id`,`cache_language_id`),
			  KEY `cache_id` (`cache_id`),
			  KEY `cache_language_id` (`cache_language_id`),
			  KEY `cache_global` (`cache_global`)
			) ;

 

Jack,

 

It did the job.

 

Thanks,

Peter

Share this post


Link to post
Share on other sites

Occasionally, I see incomplete URL path requests in Google Webmaster Tools. Naturally, they return 404 server errors. Why could this be happening?

Share this post


Link to post
Share on other sites

Hello, I installed Ultimate SEO URLs v2.2d, and works great, but I want to make the URL on cyrillic. Is there such a possibility, because now makes only in latin? My store is agrotehnika.bg

Edited by tushee

Share this post


Link to post
Share on other sites

Hello, I installed Ultimate SEO URLs v2.2d, and works great, but I want to make the URL on cyrillic. Is there such a possibility, because now makes only in latin? My store is agrotehnika.bg

You can use the conversion option in this contribution to convet the characters, though that is not what you are asking. To convert the actual url's, I haven't tried it but you could try switching the database to UTF. If that doesn't work and you still need them converted, you could try the SEO 5 contribution. I don't know if it displays them either but I seem to recall seeing something about it. You may want to ask in that support thread before making the change though.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

I found the code for cyrillized URL. Here it is. But the problem is it is written for the site in the primary directory, and my site is in a subdirectory Mysite.bg/catalog. Can anyone tell me how the code looks for me.

 

 

function URL_rewrite($url) {

global $languages_id;

$matches = array();

if(preg_match("/cPath=([0-9]*)_?([0-9]+)?(&products_id=)?([0-9]+)?(.*)?/", $url, $matches)>0 && preg_match("/action=/", $url)==0) {

 

// found name - category

if(isset($matches[1])) {

$cat_id = $matches[1];

$cat_query = tep_db_query("select categories_id, categories_name from " . TABLE_CATEGORIES_DESCRIPTION . "

where categories_id = '" . (int)$cat_id . "' and language_id = '" . (int)$languages_id . "' limit 1");

$cat_string = tep_db_fetch_array($cat_query);

$cat_string = URL_safe($cat_string['categories_name']);

}

 

// found name - subcategory

if(isset($matches[2])) {

$subcat_id = $matches[2];

$cat_query = tep_db_query("select categories_id, categories_name from " . TABLE_CATEGORIES_DESCRIPTION . "

where categories_id = '" . (int)$subcat_id . "' and language_id = '" . (int)$languages_id . "' limit 1");

$subcat_string = tep_db_fetch_array($cat_query);

$subcat_string = URL_safe($subcat_string['categories_name']);

}

 

// found name - product

if(isset($matches[4])) {

$prod_id = $matches[4];

$prod_query = tep_db_query("select products_name, products_id from " . TABLE_PRODUCTS_DESCRIPTION . "

where products_id = '" . (int)$prod_id . "' and language_id = '" . (int)$languages_id . "' limit 1");

$prod_string = tep_db_fetch_array($prod_query);

$prod_string = URL_safe($prod_string['products_name']);

}

 

// data

if(isset($matches[5])) {

$extras = $matches[5];

 

$extras = substr($extras, 1);

}

 

 

if(preg_match("/(.*)index\.php/", $url)>0) {

$url = preg_replace("/index\.php.*/", "", $url);

}

 

 

if(preg_match("/(.*)product_info\.php/", $url)>0) {

$url = preg_replace("/product_info\.php.*/", "", $url);

}

 

if(isset($cat_string) && $cat_string != "") {

$url .= $cat_string."-c".$cat_id;

 

 

if(isset($subcat_string) && $subcat_string != "") {

$url .= "/".$subcat_string."-s".$subcat_id;

}

 

 

if(isset($prod_string) && $prod_string != "") {

$url .= "/".$prod_string."-p".$prod_id;

}

 

 

if(isset($extras) && $extras != "") {

$url .= "/?".$extras;

}

}

} else if(preg_match("/products_id=([0-9]+)(.*)?/", $url, $matches)>0 && preg_match("/action=/", $url)==0) {

 

if(isset($matches[1])) {

$prod_id = $matches[1];

$prod_query = tep_db_query("select products_name, products_id from " . TABLE_PRODUCTS_DESCRIPTION . "

where products_id = '" . (int)$prod_id . "' and language_id = '" . (int)$languages_id . "' limit 1");

$prod_string = tep_db_fetch_array($prod_query);

$prod_string = URL_safe($prod_string['products_name']);

}

 

 

if(isset($matches[2])) {

$extras = $matches[2];

 

$extras = substr($extras, 1);

}

 

 

if(preg_match("/(.*)product_info\.php/", $url)>0) {

$url = preg_replace("/product_info\.php.*/", "", $url);

}

 

 

if(isset($prod_string) && $prod_string != "") {

$url .= $prod_string."-p".$prod_id;

}

 

 

if(isset($extras) && $extras != "") {

$url .= "/?".$extras;

}

} // else

 

return $url;

}

 

 

 

function URL_safe($str) {

$str = strtolower($str);

$str = preg_replace("/[^АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюяa-z0-9-]+/i","-",$str);

return $str;

}

Edited by tushee

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

×