Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Hey Jack, I'd be willing to pay you if you can help me figure this out. I'm trying to solve a duplicate content issue with Google that's hurting my website.

 

It looks like the code is redirecting to the correct SEO URL when I add a '-27' at the end of the URL, but it does not when I enter a '_27'.

 

Is there an easy modification to the code to do the same for underscores?

 

Example:

(manipulated URL with hyphen) littmann-classic-stethoscope-p-131-27.html

(redirects to correct SEO URL) littmann-classic-stethoscope-p-131.html

 

However the code is not redirecting to the correct SEO URL when I add a '_27' at the end of the URL.

 

Example:

(manipulated URL with underscore) littmann-classic-stethoscope-p-131_27.html

(does not redirect) littmann-classic-stethoscope-p-131-27.html

 

I honestly don't know how Google got the underscore URLs in their index, I'm still researching. I figure I can fix the issue by validating the URL which the addon seems to already be doing for hyphens but not underscores?

 

Any thoughts?

Edited by burt
removed live url
Link to comment
Share on other sites

This addon doesn't do anything with changes after the id so placing invalid characters there may or may not be handled. As mentioned before, it is a waste of time to change the code of this addon to fix a problem in the core code. Fix the core code problem and this addon will work as it should. I've sent you a PM regarding my work.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

This addon doesn't do anything with changes after the id so placing invalid characters there may or may not be handled. As mentioned before, it is a waste of time to change the code of this addon to fix a problem in the core code. Fix the core code problem and this addon will work as it should. I've sent you a PM regarding my work.

 

Thanks, PM sent.

Link to comment
Share on other sites

You can send a message to a moderator by using the Report link in the lower right part of your post, next to the Multiquote button.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

We have better things to do than go through posts one by one updating URLs.

 

Bear in mind that these URLs were inserted by you in order to garner help.

 

Agreed, and apologies. Thanks very much for updating the links, much appreciated.

Edited by bbott
Link to comment
Share on other sites

Has anyone gotten SEO URLs to work with extra product image addons? (i.e. http://addons.oscommerce.com/info/1289)

 

I tried modifying the code (examples below, added code is in RED), but it doesn't seem to work.

 

 

HTACCESS:

RewriteRule ^(.*)-pei-(.*).html$ popup_extra_image.php?peiID=$2&%{QUERY_STRING}

 

SEO.CLASS.PHP:

 

//ojp FILENAME_LINKS

$seo_pages = array(FILENAME_DEFAULT,

FILENAME_PRODUCT_INFO,

FILENAME_POPUP_IMAGE,

FILENAME_POPUP_EXTRA_IMAGES,

================================================================================

 

 

$this->reg_anchors = array('products_id' => '-p-',

'cPath' => '-c-',

'manufacturers_id' => '-m-',

'pID' => '-pi-',

'peiID' => '-pei-',

================================================================================

 

case 'peiID':

switch(true){

case ($page == FILENAME_POPUP_EXTRA_IMAGES):

$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html', $separator);

break;

default:

$container[$p2[0]] = $p2[1];

break;

} # end switch

break;

 

 

I searched, but haven't had any luck finding my answer.

Edited by bbott
Link to comment
Share on other sites

hello,

 

I am getting 404 soft errors on google webmaster tools for my site. about 115 of them all just recently.

 

it showing my crawling my site and finding urls like this:

 

http://www.mysite.com/product1.html

 

where I do not have products stored there.

 

the url should read:

 

http://www.mysite.com/someCategory/product1.html

 

my .htaccess file is configured correctly.

 

I have Ultimate_SEO_URLSv22d_11 add on installed.

 

is there something maybe with the configurations of seo url that is making this happen.

 

I have the add category parent to product and add to beginning set to false but these have been configured like this for

quite sometime,

that Is why I do not understand why all of a sudden this is happening.

 

 

 

 

thanks,

 

craig

Edited by zpupster
Link to comment
Share on other sites

That's not a url this addon would generate (neither of them). So either you have a file with that name, there is something wrong with your code or you didn't provide the correct url.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

the url here is edited a little also, after further research it looks like these products in admin cat/prod>> status>> is turned off.

 

 

this is how the url is reported as a crawl error by google

 

http://mysite.com/unit-700476-p-990.html

 

and the index page is returned with "product not found"

 

I was thinking I do not have a product urls like that it should have a category attached like this.

http://mysite.com/phones/unit-700476-p-990.html

 

 

Link to comment
Share on other sites

I can only guess when given wrong or incorrect url's so I won't comment on that. But 404 errors can be fixed with the Header Status Handler addon I recently uploaded.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...

I would like to be able to add a fixed word onto all of my categories. I sell auto owners manuals so my categories are Acura, Buick, Honda, Dodge, etc. I don't want the words owners manuals added to each of my categories. I just want it added to the urls so that my urls look like acura-owners-manuals-c-22.html instead of acura-c-22.html. How do I do that? I really like this contribution so I would like to keep it instead of uninstalling and having to reinstall another contribution. It works great with everything else.

Link to comment
Share on other sites

There's no way to do that short of altering its code. If you have Header Tags SEO installed and the title for the page has the additional word, you can use the option in this addon to use that title.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

I'm using this module for my site. My site is not an English site so the generated link is not expected.

#

Example:

Category name: "phần cứng" <~~ this means "hardware" in English (This is Vietnamese)

Generated links: "http://megaplaza.vn/phn-cng-c-1.html"

#

So, "phần cứng" has become "phn-cng".

#

Someone please tell me how two letters "ầ" and "ứ" is removed. Which function in seo.class.php is responsible for that work?

I tried but I cannot find it.

Thanks in advance!

Link to comment
Share on other sites

@@Jack_mcs: It will take too much time to add more vietnamese letters which is special characters in English...

Anyway, I've just found the way to handle this business.

/**
* Function to strip the string of punctuation and white space
* @[member='author'] Bobby Easland
* @version 1.1
* @[member='param'] string $string
* @[member='Return'] string Stripped text. Removes all non-alphanumeric characters.
*/
function strip($string)
{
 $string = $this->vnSeo($string);
 if (is_array($this->attributes['SEO_CHAR_CONVERT_SET'])) $string = strtr($string, $this->attributes['SEO_CHAR_CONVERT_SET']);
 $pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
	 //? "([^[:alnum:]])+"
	 //:	 "([[:punct:]])+";
	 ? "([^[:alnum:]])"
	 : "/[^a-z0-9- ]/i";
 $string = preg_replace('/(('))/', '-', strtolower($string)); //remove apostrophe - not caught by above
 //$anchor = preg_replace($pattern, '', mb_convert_case($string, MB_CASE_LOWER, "utf-8"));
 $anchor = preg_replace($pattern, '', strtolower($string));
 $pattern = "([[:space:]]|[[:blank:]])";
 $anchor = preg_replace($pattern, '-', $anchor);
 return $anchor;
 //return $this->short_name($anchor); // return the short filtered name
} # end function

/**
* Function to convert vietnamese string to ASCII string
* @[member='author'] Manhhailua
* @version 1.0
* @[member='param'] string $string
* @[member='Return'] string which contain no word in Vietnamese
*/
function vnSeo($string)
{
 $ttk = array(
	 'a' => array('ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ', 'ắ', 'ằ', 'ẳ', 'ẵ', 'ặ', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ', 'Ặ', 'á', 'à', 'ả', 'ã', 'ạ', 'â', 'ă', 'Á', 'À', 'Ả', 'Ã', 'Ạ', 'Â', 'Ă'),
	 'e' => array('ế', 'ề', 'ể', 'ễ', 'ệ', 'Ế', 'Ề', 'Ể', 'Ễ', 'Ệ', 'é', 'è', 'ẻ', 'ẽ', 'ẹ', 'ê', 'É', 'È', 'Ẻ', 'Ẽ', 'Ẹ', 'Ê'),
	 'i' => array('í', 'ì', 'ỉ', 'ĩ', 'ị', 'Í', 'Ì', 'Ỉ', 'Ĩ', 'Ị'),
	 'o' => array('ố', 'ồ', 'ổ', 'ỗ', 'ộ', 'Ố', 'Ồ', 'Ổ', 'Ỗ', 'Ô', 'Ộ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'Ớ', 'Ờ', 'Ở', 'Ỡ', 'Ợ', 'ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ơ', 'Ó', 'Ò', 'Ỏ', 'Õ', 'Ọ', 'Ô', 'Ơ'),
	 'u' => array('ứ', 'ừ', 'ử', 'ữ', 'ự', 'Ứ', 'Ừ', 'Ử', 'Ữ', 'Ự', 'ú', 'ù', 'ủ', 'ũ', 'ụ', 'ư', 'Ú', 'Ù', 'Ủ', 'Ũ', 'Ụ', 'Ư'),
	 'y' => array('ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ'),
	 'd' => array('đ', 'Đ'),
	 //'' => array('”', '“', 'quot', 'grave', 'circ', 'tilde', 'acute', '~', '!', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '+', '=', '`', '{', '}', '[', ']', '|', '<', '>', ',', '.', '?', '/', '\"', '\'', ':', ';'),
 );
 foreach ($ttk as $key => $arr) {
	 foreach ($arr as $val) {
		 $string = str_replace($val, $key, $string);
	 }
 }
 return trim($string);
}

My changes make function "short_name()" become useless. I haven't understood this function yet and it makes my string result go wrong. So, I temporarily don't use it. As you can see in my function "vnSeo()", there are too many special characters which will be replaced by another simple character so I really don't want to use the character conversion. If the input format can be "char1,char2,char3...charn=>conv",I would consider it.

Edited by Manhhailua
Link to comment
Share on other sites

I have installed Ultimate SEO V2.2d contribution onto my website

 

my problem is when clicking on the categories instead of viewing my url as following

 

mydomain.com/category1-c-23.html

 

its showing like the following

 

mydomain.com/-c-23.html <-- also shows like this in the status

 

 

same issue with products i have turned on the add manufacture to product URL and its showing as following

 

mydomain.com/manufacture1--p-2.html <---- shows correctly before clicking in the status bar

 

 

what am i missing is there something i am doing wrong when i highlight the product it shows the url correctly in the status bar but when clicked its switching to the above url

Link to comment
Share on other sites

The name comes from the products name so be sure your products have names. If you have cache enabled, try turning it off, uninstalling this addon with the setting in admin and refreshing the home page to see if that fixes it. If you are not using my latest version, please try that. Other than those suggestions, I don't have any other guesses.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jack, sorry to bother you, I hope you can help me.

 

I have Ultimate SEO V 2.2d-11 installed and it was working perfectly, however I just renamed my catalog directory and now it is giving me 404 errors when I have SEO URLS turned on. Is there somewhere I need to change the directory name in the code or something?

 

Thanks a lot!

Link to comment
Share on other sites

No, you shouldn't have to do anything. It is probably a cache issue. Try turning it off and make sure the link works. If it does, turn it back on and clear the cache.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks @@Jack_mcs, but that didn't work.

 

With SEO turned off the links work fine, but turned on I get the 404 error. I've tried clearing the cache and multiple browsers.

 

I have no idea what the issue is, I guess I'll keep looking...

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