I wrote code to manage Urlrewriting in Application_Beg inRequest:
if (!System.IO.Fil e.Exists(Reques t.PhysicalPath) )
{
string sRequestedUrl = Request.Path;
string sTargetUrl = GetRurl(sReques tedUrl);
Context.Rewrite Path(sTargetUrl , false);
}
GetRurl map real url on virtual url.
I get a problem with images ref. In the root dir i have a subdir called
images and in html code I have ref like these:
<img src="images/img.jpg">
or
<body background="ima ges/back.jpg">
When the code transforms shop/books/one.html in content.aspx?id =123456 I
obtain an exception due to wrong path (shop/books/images/img.jpg instead
of images/img.jpg). If a use ref like ~/images/img.jpg I still obtain
wrong Request.Physica lPath...
The url of my application is http://MySite/MyApp.
Can you help me?
Bye
Fransis
if (!System.IO.Fil e.Exists(Reques t.PhysicalPath) )
{
string sRequestedUrl = Request.Path;
string sTargetUrl = GetRurl(sReques tedUrl);
Context.Rewrite Path(sTargetUrl , false);
}
GetRurl map real url on virtual url.
I get a problem with images ref. In the root dir i have a subdir called
images and in html code I have ref like these:
<img src="images/img.jpg">
or
<body background="ima ges/back.jpg">
When the code transforms shop/books/one.html in content.aspx?id =123456 I
obtain an exception due to wrong path (shop/books/images/img.jpg instead
of images/img.jpg). If a use ref like ~/images/img.jpg I still obtain
wrong Request.Physica lPath...
The url of my application is http://MySite/MyApp.
Can you help me?
Bye
Fransis
Comment