Hi,
We have implemented URL rewriting in our site. It all went OK till
home page links.
When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.
problem comes now...
on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].
E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....
can anyone please help...?
l.holota@hotmail.com - 26 Dec 2007 09:35 GMT
Hi,
solved this either, you have to use complete absolute paths like
http://www.example.com/Images/...., or do it like me :) creare rewrite rules
with regular expressions - rewrite wrong paths to the right ones. I have my
own rewriting module, so it was easy...
Regards,
Lukas Holota
> Hi,
>
[quoted text clipped - 18 lines]
>
> can anyone please help...?
Harsh Trivedi - 26 Dec 2007 12:04 GMT
We have written like this:
1) Place the function to rewrite in global.asax file in Begin request
event
2) Create the function that will be called by step -1
3) Create the xml file for url mapping and use Reg ex
4) Once false path is found for the url,
HttpContext.Current.RewritePath(newPath)
On Dec 26, 2:35 pm, <l.hol...@hotmail.com> wrote:
> Hi,
>
[quoted text clipped - 28 lines]
>
> > can anyone please help...?
l.holota@hotmail.com - 27 Dec 2007 23:33 GMT
I recommend to implement this as an IHttpModule, it's more practical and
easier to implement to other applications
Regards,
L.Holota
> We have written like this:
>
[quoted text clipped - 41 lines]
>>
>> > can anyone please help...?
Med - 26 Dec 2007 13:40 GMT
Hi,
Try Page.ResolveUrl("~/Images/Pen.jpg") or
Page.ResolveClientUrl("~/Images/Pen.jpg") see if it works.
Regards
Med
> Hi,
>
[quoted text clipped - 18 lines]
>
> can anyone please help...?