Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 27, 2012 04:03 PM by RKD
0 Points
1 Post
Aug 20, 2010 10:39 PM|LINK
Alsalamo 3alaykom ,
as we know that if you use Intelligencia.UrlRewriter.RewriterHttpModule or IIS URL Rewriting , we will face problems with arabic urls
as this
http://localhost:1234/Pages/نائب العميد للشؤون الأكاديمية
and the Rule is :
void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().Contains("/Pages/")) { String[] txt= Regex.Split(HttpContext.Current.Request.Url.ToString(), @"/"); String page = txt[txt.Length-1]; HttpContext.Current.RewritePath("~/ShowPages.aspx?Page="+Uri.EscapeDataString(page)); } }
Uri.EscapeDataString is the solution ..
and in ShowPages.aspx you should escape the String back .
Uri.UnescapeDataString(Request.QueryString["Page"])
any Questions ?
Regards
Ahmed Diab
URL Rewriting Arabic url Querystring Encoding
Member
4 Points
2 Posts
May 27, 2012 04:03 PM|LINK
im using url rewrite and facing problems with arabic characters in url, can u please tell how exactly to use your code and where to put it?
Arabic url Querystring Encoding
dev.ahmed
0 Points
1 Post
Arabic QueryString with Url Rewrite Solution
Aug 20, 2010 10:39 PM|LINK
Alsalamo 3alaykom ,
as we know that if you use Intelligencia.UrlRewriter.RewriterHttpModule or IIS URL Rewriting , we will face problems with arabic urls
as this
http://localhost:1234/Pages/نائب العميد للشؤون الأكاديمية
and the Rule is :
void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().Contains("/Pages/")) { String[] txt= Regex.Split(HttpContext.Current.Request.Url.ToString(), @"/"); String page = txt[txt.Length-1]; HttpContext.Current.RewritePath("~/ShowPages.aspx?Page="+Uri.EscapeDataString(page)); } }Uri.EscapeDataString is the solution ..
and in ShowPages.aspx you should escape the String back .
Uri.UnescapeDataString(Request.QueryString["Page"])
any Questions ?
Regards
Ahmed Diab
URL Rewriting Arabic url Querystring Encoding
RKD
Member
4 Points
2 Posts
Re: Arabic QueryString with Url Rewrite Solution
May 27, 2012 04:03 PM|LINK
im using url rewrite and facing problems with arabic characters in url, can u please tell how exactly to use your code and where to put it?
Arabic url Querystring Encoding