Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Tilde ~ causes problem - URL Rewrite

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harsh Trivedi - 26 Dec 2007 06:21 GMT
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...?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.