Hi Ben,

I know that in Apache, and probably in ISAPI although I've not used it, 
there is a way to either redirect or not redirect.  In other words, although 
the rewrite takes place at the server level either way, and the appropriate 
page is served up, doing "redirect" will make it so the url pushed to the 
browser is actually changed to the rewritten version.  This would make it so 
you didn't have to re-do all your relative links.

The down side of using "redirect" of course is that the end user sees the 
rewritten url in their browser, so if your boss/client is concerned about 
that then you're out of luck.  The up side is that you can use your slim and 
trim urls in any advertising/linking that you may want to do, and they will 
work fine, and also your relative links will work fine.

Assuming you have your rewrite all set up:

With redirect:
incoming url:  www.foo.com/blabla
serves page: www.foo.com/page.cfm?pageid=blabla
browser url: www.foo.com/page.cfm?pageid=blabla
Relative links work fine

Without redirect:
incoming url:  www.foo.com/blabla
serves page: www.foo.com/page.cfm?pageid=blabla
browser url: www.foo.com/blabla
Relative links don't work

I don't have tons of experience with this either so if I'm off please anyone 
jump in with corrections.

-- Josh




----- Original Message ----- 
From: "Ben Nadel" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Friday, June 09, 2006 8:55 AM
Subject: RE: User Friendly URLs for dynamic content


> Jack,
>
> Just wanted to add something... We were experimenting with ISAPI rewrite 
> and
> it is awesome. The one issue we had it that from the COldFusion code
> standpoint, you have no idea that any re-write too place. That can be a 
> good
> thing, it can be a bad thing. Let's say you have relative links in your 
> site
> and someone goes to the page:
>
> About/firm.cfm
>
> There might be a link like "../contact.cfm" to go up and to contact.
>
> Now, let's say that someone gets to that same page via a ISAPI redirect:
>
> Blah/foor/bar/aboutfirm.
>
> Now, it redirects in IIS to about/firm.cfm , which is how CF sees it, and
> hence has links like "../contact.cfm". However, from the browsers
> standpoint, you are several directories deep and that same link would go 
> to:
>
> Blah/foo/contact.cfm
>
> Which is way off.
>
> So basically, you just have to accept that with ISAPI rewrite, you can't
> have relative links on pages that might be accesseed in these two 
> different
> ways. Also from the CF standpoint, there are no CGI variables available 
> that
> would allow the programmer to know if an re-write was done.
>
> Now, this is with my LIMITED experience so this may be wrong. But it was I
> have found. If I am wrong PLEASE correct me as I really would like to use
> ISAPI rewrite.
>
>
: http://www.houseoffusion.com/tiny.cfm/54 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243068
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to