how to rewrite url to lower case in asp.net

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/22/2011 2:46:53 AM
Gravatar
Total Posts 2

how to rewrite url to lower case in asp.net

Hi i hava tried implementing this code for url rewriting to lower case but it is not working

protected void Application_BeginRequest(object sender, EventArgs e)
        {
                       string lowercaseURL = (Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.Url.AbsolutePath);
            if(Regex.IsMatch(lowercaseURL,@"[A-Z]"))
            {
                lowercaseURL = lowercaseURL.ToLower() + HttpContext.Current.Request.Url.Query;

                Response.Clear();
                Response.Status = "301 Moved Permanently";
                Response.AddHeader("Location", lowercaseURL);
                Response.End();
            }
        }

it is working well in visual studio on my computer but when i host it on my server in godaddy its not working . can any one help me

example

google is considering urls

www.mydomain.com/Hyderabad.aspx and www.mydomain.com/hyderabad.aspx as two different pages and my page ranks are getting spoiled .

 

please help me

 

You must sign in to post in the forums. This thread is closed to new posts.