F
Fransis il Mulo
I wrote code to manage Urlrewriting in Application_BeginRequest:
if (!System.IO.File.Exists(Request.PhysicalPath))
{
string sRequestedUrl = Request.Path;
string sTargetUrl = GetRurl(sRequestedUrl);
Context.RewritePath(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="images/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.PhysicalPath...
The url of my application is http://MySite/MyApp.
Can you help me?
Bye
Fransis
if (!System.IO.File.Exists(Request.PhysicalPath))
{
string sRequestedUrl = Request.Path;
string sTargetUrl = GetRurl(sRequestedUrl);
Context.RewritePath(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="images/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.PhysicalPath...
The url of my application is http://MySite/MyApp.
Can you help me?
Bye
Fransis