Click here to Skip to main content
15,041,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to use URL rewriting for a asp.net application pages but those are html pages (static site pages).

Here the code i am using in my global.asax file:

C#
void Application_BeginRequest(object sender, EventArgs e)
   {
       HttpContext context = HttpContext.Current;
       string file = Request.Url.LocalPath.ToLower();
       if (file.Contains("residential-treatment-program"))
       {
           Context.RewritePath("/Plumfield/residences/residences.html");
       }
   }


its working and the page is redirecting from "/Plumfield/residences/residences.html" to "residential-treatment-program". But the issue is after rewriting the "residential-treatment-program" page lost his CSS ,Images and js.

Any Idea how to fix this?

Thanks
Posted
Updated 10-Feb-14 7:19am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900