Skip to content

Url rewriting

icanmakeiteasy

Asked Feb 11, 2009, 12:34 AM EST1 answer
Share
LinkedInX
Hi, protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext context = HttpContext.Current; if (context.Request.FilePath.ToString().StartsWith("/hotels-in-")) { context.RewritePath("country.aspx"); } } this is my code in global.asax.cs file http://........../hotels-in-India //url is like this Not Found The requested document was not found on this server. just its showing like this this code is working in local system but when i uploaded the project to server its not working what to do??........ please help me...thx

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    First of all you have to check whether you have the required permissions to run this code in the remote machine, you know that permission are categorized within a .Net context as follow: go to

    Start>Configuration panel>.Net x.x version Configuration
    Expand the workstation tree node then expand the permission set you will discover that the permisson given in a local machine is not the same given to the internet and remote context

    So you have to contact the administrator of the remote server and ask him to give you the required permission sets
    0