Useful header in ISAPI_Rewrite: HTTP_X_REWRITE_URL

I’ve been using ISAPI_Rewrite 3 for some time now to rewrite URLs on my IIS server, and generally to create SEO-friendly URLs.

One thing I only discovered today (and am blogging here mainly for my own future reference) is that for every request, the rewrite engine creates a server variable, HTTP_X_REWRITE_URL, which contains the original requested URL. It was useful for me today, as I was writing a missing page handler, but I can think of many other occasions I’ve had to create complicated workarounds to work out what the requested URL was.

Which brings me to a slight oddity. I’m sure I’d have discovered this incredibly useful feature earlier, if it had shown up when I do a dump of the CGI scope. But for some reason, it doesn’t.

I’ve tried doing a cfdump of the CGI scope; and I’ve tried looping over the scope as a collection; but in neither case does the header get returned.

Yet if I make an explicit reference to CGI.HTTP_X_REWRITE_URL – as if by magic, the URL appears…

I’m sure there’s a perfectly reasonable explanation for this – but I wonder how many other similar variables ColdFusion is choosing not to show us?

No comments Posted on 2 December, 2008, under ColdFusion, ISAPI_Rewrite

Eagle owl

Eagle owl

Really excited to have seen this eagle owl yesterday and today (it’s in the wild, somewhere in the South West of England).

It was too dark to get a decent photo last night, but we did see it fly off at dusk – a pretty impressive sight. So we went back this morning to get a photo in daylight.

No comments Posted on 2 November, 2008, under Photos

IE6 gzip bug: solved using ISAPI_Rewrite

I've recently turned on gzip compression for all static pages on my web server running IIS6, and am now enjoying faster speeds and lower bandwidth.

However, in my investigations I came across a number of bugs in pre-SP2 IE6 (no surprises there) which means that gzipped CSS and Javascript files can be improperly cached and so intermittently mangled.

Not wanting to turn compression off just because of problems with this (thankfully declining) travesty of a browser, I hit on a way of bypassing compression for the affected browsers.

Read more »

No comments Posted on 31 October, 2008, under Miscellaneous, ISAPI_Rewrite

Woopra plugin for Mango

I've created another plugin for Mango - this time to integrate Woopra tracking and analytics.

Woopra logoWoopra's currently in beta, but I've been using it for some months now and it looks great; and with an API due to be opened up soon, there are lots of groovy features to come...

Read more »

1 comment Posted on 17 October, 2008, under ColdFusion, Mango Blog

Back with a new design…

It’s been an embarrassingly long time since my last post, but I’m back now and have finally got around to building a custom skin for Mango.

I expect the design may be tweaked here and there over the coming weeks; but I just wanted to get it out there to see how it looks…

I also hope to devote more time to developing for Mango now, so watch this space!

2 comments Posted on 14 October, 2008, under Miscellaneous, Mango Blog