zznic Posted August 27, 2013 Share Posted August 27, 2013 I would like to change the way my urls are shown, I'd rather have the name of the product on the url than the codes now showing. I have been through the Admin page and found out that I have first to install .htaccess and then change from no to yes in the Activate URLs for SEO optimization drop down menu. Now my question is, the shop is on line since quite a long time, can I do it now and is it difficult to do? Will I face any problem at all? Thanks a lot for your kind feeback regards Nicola :-) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 It's easy enough to do, and the htaccess is designed to take care of redirects from the old urls to the new. Be sure to rebuild the caches and create a new sitemap and export your catalog to Google or wherever you send yours. Copy some of the current urls so you can see if they redirect correctly to the seo urls. If not, report back with what the original and the new turned out to be. PS Thank you for providing your setup info in your sig!! Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Thanks a lot for the hints, I already created the .htaccess and I'm going to switch to the SEO Urs. When you say rebuild the caches you mean that I have to mark all four delete cache options, correct? Ciao, Nicola It's easy enough to do, and the htaccess is designed to take care of redirects from the old urls to the new. Be sure to rebuild the caches and create a new sitemap and export your catalog to Google or wherever you send yours. Copy some of the current urls so you can see if they redirect correctly to the seo urls. If not, report back with what the original and the new turned out to be. PS Thank you for providing your setup info in your sig!! Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Looks like I have found an issue on the URLs, for example the word "señuelos" carries the spanish "ñ" and in the url it is replaced by a - sign so it reads se-uelos. I have compared with other spanish webs and the word is writen correctly on the URL. Any idea? thanks, ciao Nicola Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 Can you give us an example of a URL (a web address) that contains a diacritical marked character - such as the ñ? All the rules that define how the Internet works state that only ASCII characters are allowed in URLs. (I'm working on a hack that offers translations to the friendly URL part of the whole Search Engine aspect of CubeCart.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 I would have cleared all caches, but Bsmither might prefer something else, since you're dealing with a translation issue. If you haven't already, wait for confirmation from Bsmither. Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Here's the example where you se-uelos should be señuelos. Other webs carry the ñ http://www.caranx.net/store/se-uelos.html thanks, ciao Nicola Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 Sorry, I wasn't clear. Can we have an actual web address where the ñ actually appears? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 I Googled Senuelos with the cadilla (don't know how to show it here) -- anyway, the link I checked was senuelosvense.com, and it did not have the hyphen nor did it have the cadilla. The TEXT and META TITLE did show the cadilla. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 Interesting about the <title>, it has been my experience that the <title> as shown in the browser window title bar does not show HTML entities as the entity ( , for example, will show as opposed to an actual space). But apparently the title bar is UTF-8 compliant. There has been some discussion about making URLs internationally aware, but I am not sure it has been implemented anywhere. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 I would add that in our case I have to use Carters, rather than Carter's in the Product Names to keep the url from being carter-s- . I could have edited the SEO urls to take out the hyphen, but I didn't understand that when I started the store. Until recently, thanks to Bsmither's help, I couldn't get Carter's with the apostrophe to work as a search term within the store, so it didn't matter. I just copy/pasted cañas from one of your listings into the Spanish language Search Box, and it didn't find your items. Looks like you're going to have to use Bsmither's tweak of the search code to make your searches work. But that's another matter that should be easy to fix with his tweak. Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Ok, let's resume for the idiot - which is me obviously - there's not much that I can do with my limited skills and knowledge, I will wait to see if something happens with the Cart updates. Funny, I tried to attach the url of a shop that shows the ñ in the url and once pasted here would turn the ñ into some %& and stuff like this... :-) Thanks again, ciao Nicola PD: what shall I do with the cache, delete them all to restore? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 To show the url leave the http:// part off - otherwise the shortening mechanism happens - and to keep the code mess from happening try clicking on the <> up in the editing row just above where we type in the post and put it in there. If that doesn't work, just copy/paste the url and I'll see if I can get it to show. Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Here it is formulapesca.com/es/señuelos-artificiales/peces-hart/peces-hart-shore-minnow-125.html Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 Here is what the URL actually looks like: /es/ca%C3%B1as-pesca-bolo%C3%B1esa /es/se%C3%B1uelos-artificiales/peces-hart/peces-hart-shore-minnow-125.html The international character is being converted to its URL-encoded UTF-8 two-byte equivalent: %C3%B1 Knowing this, we can then convince CubeCart to do the same. (Only very specialized tools will reveal the raw stream of characters. Almost every other inspection tool will "for your convenience" convert a convertible sequence until it can't be converted anymore, that is, by showing the final character.) Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Thanks BSmither, when you have a second please let me know what I'm supposed to do with the cache, cancel them all? ciao Nicola Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 Do not worry about deleting the caches just yet. Please let us know what your URLs look like that you want changed. I see URLs like: /carretes/accurate-boss-bx400.html, which is the standard format for CC5. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 If you are skilled at editing (using a programmer's text editor), in the file /includes/functions.inc.php, find the function sanitizeSEOPath. Replace it completely with:function sanitizeSEOPath($path) { ## Remove extention $path = preg_replace("/.w{2,4}$/", '', $path); ## Make path lowercase - as much as possible $path = mb_strtolower($path); ## Encode multi-byte characters (UTF-8) $path = implode("/", array_map("rawurlencode", explode("/", $path))); ## Allow 0-9, a-z, A-Z, -,_ and / and % $path = preg_replace('/[^a-z0-9-_/%]/i', '-', $path); ## Remove any odd double dashes return str_replace('--', '-', $path); } (I haven't tried this yet.) Quote Link to comment Share on other sites More sharing options...
zznic Posted August 27, 2013 Author Share Posted August 27, 2013 Bsmither, you scare me a bit, what does it means "I haven't tried this yet" ? :-) I found the text and I'm probably able to edit it but what is it for? thanks, ciao Nicola Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 27, 2013 Share Posted August 27, 2013 This routine is called by a function, one of a number of functions that specialize in doing all things necessary to create, put in the database, and recall from the database, the search-engine-friendly URLs. That particular function, setdbPath, has the job of determining if a friendly URL (let's call it a 'path') already exists in the database. And if not already used, the function makes sure the path you want to use conforms to established URL syntax. The routine that makes sure the path conforms to established URL syntax replaces any illegal character with a dash and makes the whole path lower-case. The new code makes one more replacement -- international characters with their URL conforming version. I said I haven't tried it yet because I am in the middle of making some changes to other parts of the code. But I will shortly. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 27, 2013 Share Posted August 27, 2013 Make a backup copy of the whole file, includes.inc.php, either in Filemanager within cpanel, or via FTP. Then, if you were to get confused you can always put the original back in quickly, With that done, Go near the end of the file and find this section: /** * Sanitize SEO allowed path * * @return string */ function sanitizeSEOPath($path) { ## Remove extention $path = preg_replace("/.w{2,4}$/", '', $path); ## Make path lowercase $path = strtolower($path); ## Allow 0-9, a-z, -,_ and / $path = preg_replace('/[^a-z0-9-_/]/', '-', $path); ## Remove any odd double dashes return str_replace('--', '-', $path); } Replace it with the code Bsmither provided. No need to be concerned - Bsmither knows what he's doing - as long as you have a backup you're safe. He's attempting to change the way in which CC deals with your Spanish characters. Quote Link to comment Share on other sites More sharing options...
zznic Posted August 28, 2013 Author Share Posted August 28, 2013 Thanks again, I will give it a try and come back to you ciao Nicola :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.