Farsi (Persian) characters in URL ?? |
[eluser]Mohsen32[/eluser]
I got an error saying that those farsi (Persian) characters are not allowed in URLs, You know, It's essential for SEO. How can I allow Farsi characters (Such as: ا ب پ ت) without risking anything.
[eluser]eoinmcg[/eluser]
In short you can't have Farsi characters in your URLs According to the RFC 1738: Uniform Resource Locators (URL) specification: Quote:"Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL" See also this thread For SEO purposes you can, of course, have your page title in Farsi. Good luck
[eluser]Ibrahim Mohamed Abotaleb[/eluser]
I have tried to solve this problem to use arabic characters in url and i have reach to convert allowed characters variable in config to disallowed characters like Code: $config['permitted_uri_chars'] = '~`!#$%^&()[]{};\':",<>'; from Code: if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) Code: if ( preg_match("|^.[".preg_quote($this->config->item('permitted_uri_chars'))."]|", $str))
[eluser]Mohsen32[/eluser]
[quote author="eoinmcg" date="1246275123"]In short you can't have Farsi characters in your URLs According to the RFC 1738: Uniform Resource Locators (URL) specification: Quote:"Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL" See also this thread For SEO purposes you can, of course, have your page title in Farsi. Good luck[/quote] How come wikipedia could do something like this: fa.wikipedia.org/wiki/گوگل [quote author="Ibrahim Mohamed Abotaleb" date="1246289955"]I have tried to solve this problem to use arabic characters in url and i have reach to convert allowed characters variable in config to disallowed characters like Code: $config['permitted_uri_chars'] = '~`!#$%^&()[]{};\':",<>'; from Code: if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) Code: if ( preg_match("|^.[".preg_quote($this->config->item('permitted_uri_chars'))."]|", $str)) Is there any security risk in this solution?
[eluser]Sbioko[/eluser]
You can set permitted_uri_chars to ''. But don't forget to xss cleaning in URI.php function _filter_uri. I successfully do things like that.
|
Welcome Guest, Not a member yet? Register Sign In |