Welcome Guest, Not a member yet? Register   Sign In
Farsi (Persian) characters in URL ??
#1

[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.
#2

[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
#3

[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'] = '~`!#$%^&()[]{};\':",<>';
and edit URI library in line 189
from
Code:
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
to
Code:
if (  preg_match("|^.[".preg_quote($this->config->item('permitted_uri_chars'))."]|", $str))
#4

[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'] = '~`!#$%^&()[]{};\':",<>';
and edit URI library in line 189
from
Code:
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
to
Code:
if (  preg_match("|^.[".preg_quote($this->config->item('permitted_uri_chars'))."]|", $str))
[/quote]

Is there any security risk in this solution?
#5

[eluser]Mohsen32[/eluser]
Any help with this dirty problem?
#6

[eluser]behrooz[/eluser]
i have this problem ??
#7

[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.
#8

[eluser]behrooz[/eluser]
thank you
happy birthday
#9

[eluser]Sbioko[/eluser]
Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB