SEO addon stripping out underscores

The SEO addon strips off underscore characters and capitalized letters that I am trying to import via csv, and also if I try to manually update them using the same.

Where can I change the string that does this? I presume there is a function somewhere that eliminates certain characters and forces lowercase from being part of the url. This wouldn’t be an issue, but google has 24k of our URLs with this and I don’t plan on losing all them by using newly generated ones.

currently, my urls look like this product_something_PARTNUMBERCAPS.html

Anyone got an idea of how to change this?

On our about line 2842 (V2.1.2) in core/fn.catalog.php you will see a line like:

$str = strtolower($str); // only lower letters

Comment it out if you do not want things to be lower case. However, I would suggest that you research this topic before doing so.

Thanks for pointing me in the right direction.

I removed that line and it still stripped the caps, but on the lines that followed, it defined the acceptable characters, so I added A-Z and the _ underscore to allowable characters and it did the trick. I wonder if the line you pointed me at is redundant code with the lines that follow?

I would like to change the format of the URL, but with so many listed in google, I’m not willing to take that chance.

I would like to see cs-cart add the URL history like x-cart does, so that even if google points to the old URL, it is automatically forwarded to the current seo URL to avoid being dropped.

Thanks again, you helped solve this one for me

I believe that your upper case characters will be ignored since I do not believe that URL’s are case sensitive for search purposes. In fact, you might run into an issue where a referrer forces to lower case and then it won’t resolve on your server. Buyer beware.

I had been thinking about doing an addon for SEO history so that you would not be penalized for older (unused) urls. But I’ve never seen enough interest to warrant the effort required to do so.

Thanks for the tip on that. I did google my domain and clicked on one of the links, then changed the uppercase to lowercase in the URL and it still worked, which is a good sign.

I’m kind of surprised that CS did not think to do this. Now if you change a SEO URL, the result will be a 404 from your store? That doesn’t quite seem to be a good way to handle this at the moment. CS should consider putting this feature in as part of the SEO addon.

Personally I think making it consistently lower case in a url is preferred. I know that for domain names, they are case-independent but then I also know that the URI is not. It’s confusing for merchants and others. Hence, having it consistently be lower case is preferred IMHO.