By my reckoning, if a product name has a dash, it is converted to %252d in the URL. I have now amended my general.php in the lib directory to cater for products with & in the name, I have replaced the & character with 'and'
$val = str_replace("&", "and", $val);
I have also amended the first str_replace function, so that a dash is not converted and is left as a dash. Absolutely no problems at all...yet.
[SEO] MakeURLSafe and the '/' character
Re: [SEO] MakeURLSafe and the '/' character
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
Online Garden Centre: ISC 6.0.14 Professional
-
- Posts: 2
- Joined: Tue Oct 13, 2009 3:56 pm
Re: [SEO] MakeURLSafe and the '/' character
Hepl vietnames
products " 3 Bước chuyên sâu điều trị đốm nâu và tàn nhang Omar Sharif Re20 Whiteshift Melano " page not found
Code: Select all
$val = str_replace("đ", "d", $val);
Re: [SEO] MakeURLSafe and the '/' character
I register just to thank you for your post. Best wishes for you.SamX wrote:Thank you!!! to complete this hack for spanish users who wants to add characters like:
á, é, í, ó, ú and ñ
Code: Select all
function MakeURLSafe($val) { $val = str_replace("-", "%2d", $val); $val = str_replace("+", "%2b", $val); $val = str_replace("+", "%2b", $val); $val = str_replace("/", "%2f", $val); /** *Spanish Characters - Start */ $val = str_replace("ñ", "n", $val); $val = str_replace("á", "a", $val); $val = str_replace("é", "e", $val); $val = str_replace("í", "i", $val); $val = str_replace("ó", "o", $val); $val = str_replace("ú", "u", $val); /** *Spanish Characters - End */ $val = urlencode($val); $val = str_replace("+", "-", $val); return $val; } /** * Convert an already search engine friendly based string back to the normal text equivalent. * * @param string The search engine friendly version of the string. * @return string The normal textual version of the string. */ function MakeURLNormal($val) { $val = str_replace("-", " ", $val); $val = urldecode($val); $val = str_replace("{47}", "/", $val); $val = str_replace("%2f", "/", $val); $val = str_replace("%2e", "/", $val); $val = str_replace("%2d", "-", $val); $val = str_replace("%2b", "+", $val); /** *Spanish Characters - Start */ $val = str_replace("A%F1", "ñ", $val); $val = str_replace("%E1", "a", $val); $val = str_replace("%E9", "e", $val); $val = str_replace("%ED", "i", $val); $val = str_replace("%F3", "o", $val); $val = str_replace("%FA", "u", $val); /** *Spanish Characters - End */ return $val; }

-
- Posts: 2
- Joined: Tue Oct 13, 2009 3:56 pm
Re: [SEO] MakeURLSafe and the '/' character
Hepl me!hattieuadt wrote:Hepl vietnamesproducts " 3 Bước chuyên sâu điều trị đốm nâu và tàn nhang Omar Sharif Re20 Whiteshift Melano " page not foundCode: Select all
$val = str_replace("đ", "d", $val);
-
- Posts: 4
- Joined: Tue Apr 19, 2011 6:33 pm
Re: [SEO] MakeURLSafe and the '/' character
Hi guys, maybe someone will tell how to replace:
%252f to /
%3A to :
%2C to ,
%252b to +
%3D to =
%29 to )
%28 to (
%252d to -
%21 to !
%3F to ?
Thanks a lot !!!
%252f to /
%3A to :
%2C to ,
%252b to +
%3D to =
%29 to )
%28 to (
%252d to -
%21 to !
%3F to ?
Thanks a lot !!!