Last Monday I applied a redirect rule to the site. And promptly watched (okay, so it took me 4 hours to notice...) as things went crazy & stuff broke. So, to help avoid that in the future, here's what I did & why I think it broke, and what was done to fix it. Okay, so basically, there are 4 different domain names that can get visitors to this site. That's nice and all, but it doesn't help the search engine rankings at all. Also, it just seems kind of...repetitive (let's face it; this is probably the real reason I bothered to mess with things; having 4 different paths isn't as elegant as having just one). So I downloaded the URLRewrite add-on for IIS 7.5, installed it and created a simple rule: 1: <rewrite>
2: <rules>
3: <rule name="Redirect to www.ntldr.com" enabled="true" stopProcessing="true">
4: <match url=".*" />
5: <conditions>
6: <add input="{HTTP_HOST}" pattern="^(www.)ntldr.com$" negate="true" />
7: </conditions>
8: <action type="Redirect" url="http://www.ntldr.com/{R:0}" />
9: </rule>
10: </rules>
11: </rewrite>
The rule looks at every URL used to get to the site, checks to see that the destination server is not www.ntldr.com, and then redirects the request to http://www.ntldr.com/whatever-the-original-request-was. Pretty simple, tested it internally, verified it was working, then applied it to the site and went away for a few hours.
And came back to find that the logs had tens of thousands of entries. Mostly from some computer in Kansas that kept going to / over and over and over and over again. For almost 2 hours. The bots almost universally gave up after just 6 rounds.
Of course I immediately turned off the rewrite rule and frantically began looking at logs & network traces trying to figure out what the heck was going on and how I managed to not catch it in testing. It quickly became apparent that the rule worked internally, but not from outside the Forefront TMG 2010 firewall. Which narrowed down the problem quite a bit, & made me feel less incompetent (yay! the rule worked!), but more stupid (doh! for not testing like an actual user would!).
However, examining the TMG logs didn't really yield anything useful. A request would come in, it would go to the web server, a 301 Permanent Redirect would go back, and then the client would seem to reissue the same request again. Out of desperation, I decided to take a look at the rule and noticed this tab:
At the time, "Apply link translation to this rule" was checked. And one rule is used to make all 4 hosts accessible. Consequently, this is what the Link Translation Mapping looked like:
Public name: ntldr.com
| Original URL |
Translated URL |
Mapping Details |
| http://ntldr.com |
http://ntldr.com |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://ntldr.com |
Rule Defined: ntldr.com |
Public name: ntldr.net
| Original URL |
Translated URL |
Mapping Details |
| http://ntldr.net |
http://ntldr.net |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://ntldr.net |
Rule Defined: ntldr.com |
Public name: www.ntldr.com
| Original URL |
Translated URL |
Mapping Details |
| http://www.ntldr.com |
http://www.ntldr.com |
Rule Defined: ntldr.com |
Public name: www.ntldr.net
| Original URL |
Translated URL |
Mapping Details |
| http://www.ntldr.net |
http://www.ntldr.net |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://www.ntldr.net |
Rule Defined: ntldr.com |
Oops. Fairly major, mind-numbingly stupid oops.
See, this is what was happening:
- User visits http://ntldr.net.
- Request for http://ntldr.net comes into Forefront TMG.
- Forefront TMG processes the ntldr.com rule and forwards the request to www.ntldr.com (at this point, an internal DNS alias for the actual server, tourmaline.global.ntldr.net).
- IIS gets the request and applies rewrite rules.
- Rewrite rules send a reply back saying "no, you really should go to http://www.ntldr.com".
- Reply reaches Forefront TMG. Forefront TMG applies Link Translation mappings.
- Link Translation mappings change that to "no, you really should go to http://ntldr.net".
- User dutifully goes to http://ntldr.net.
- Repeat 1-8 until the user's browser either gives up (nice browsers), or the user gives up (impatient users), or I disconnect them.
So, the solution: disable link translation in Forefront TMG. Note that I not only had to do that on the rule itself, but also in the Web Filters. That might be just because I was impatient and didn't wait for TMG to fully cycle and disable the rule-level mappings. Not sure though, and haven't had a chance to find out yet.
Now playing: The New Pornographers – Challengers – 07 Unguided
Okay, better (although less productive) idea than messing around with URL normalization: why not read that Consider Phlebas book that's just laying around? It's actually the 3rd Iain M. Banks book I've read. Summary: I liked it. It came recommended via a couple of sources, and definitely had parallels to one of the web comics that I read (Schlock Mercenary). Actually, come to think of it, maybe I read that comic because it was recommended by the same people that recommended the book...meh, don't remember now...could be another occurrence of the echo chamber phenomena of the blogosphere. I think it ranks in between the other two books. I still like Use of Weapons the most...maybe in part because it was the first one I read? Maybe I just liked the way it ended, even if it was obvious to more astute readers. But both stories come out ahead of Matter. I can't really fault the writing of Matter at all; that was excellent, with good pacing of the main storyline, quite a bit of character development, and an interesting overarching plot that integrated the annoying primitive-royalty subplot well (in the end). But I didn't like the book. That subplot & all the characters involved in it were just too...annoying. There's a similar thing with movies that I've discussed with friends (specifically regarding whether rating of films on Netflix should be based on how much one liked it or how good it was). Maybe this is true of everything...something can be good; interesting; technically very well executed...but there's no lasting emotional connection, just a slightly bad aftertaste, a desire to move on to something better... Should have figured out how to have IIS redirect requests for things like 'CommentView,guid,8c43204e-2fae-4716-bfba-7c9d3225225d.aspx' to 'CommentView.aspx?guid=8c43204e-2fae-4716-bfba-7c9d3225225d' instead... Now playing: Basia Bulat – Heart of My Own – 07 If Only You
Also, because I'm feeling extra artistic: (that's totally a dragon, not a cat with orange whiskers...the orange is *totally* fire...that's how you know it's a dragon! (otherwise, yeah, it would be a cat)) In case anyone is wondering, yes, I took art classes instead of band or orchestra or choir back in school. I also had to handwrite a lot of stuff. Apparently neither helped much (but I'm okay with that! :P)... Also, (actually, this is unrelated to the above...) tickets are booked for Berkeley! Fly down February 24th, and back February 28th. As a further aid to any potential criminals who would like to advantage of my absence & rob my apartment, my address is 1000 SW 3rd Ave, Portland, OR. Ignore the signs that say "Courthouse" & "FBI" & "U.S. Marshall"...that's just the management company's way of cheaping out on security... Oh well, that is all. Back to watching Andromeda & laughing at the awful badness until tears come...or maybe I'll just listen to the new Basia Bulat album some more while looking at URL normalization through rewrite rules...ah, the tough life of weekends! ;) Now playing: Basia Bulat – Heart of My Own – 05 Heart of My Own
Originally, this post was going to be a rant about how SQL Server Reporting Services is useless, and how Excel was so much easier for creating graphs & doing useful analysis of data. Then I spent an hour and a half messing around writing queries, executing queries, exporting & importing result sets, and then manipulating the data. So all the "oomph" has kind of gone out of that rant. Besides, I shouldn't even be messing around with this data; there are a bunch of very nice programs/scripts sitting around on the Internet to do the analysis & reporting for me. But doing things the easy way would be cheating. So instead I keep mucking around with my own custom tools & processes. In any case, here's a bunch of pretty graphs showing the human-like page views per week broken out by country of origin. Data for other views is a bit...messy...right now. The per-country stuff is fairly clean because I'm just using a geoip database to map requesting IP address to source country. (yes, one would have probably been sufficient to show what I was doing, but hey, if one is good, five is even better?) (also, in all honesty, I'm guessing I don't have enough consistent traffic to make looking at a week-by-week view meaningful; better would probably be to focus on longer time spans, like a month or so) Now playing: Matthew Barber – Ghost Notes – 06 One Little Piece of My Love
So it looks like I'm going to be down in the Bay Area February 25-28...not 100% definite yet, since I haven't booked the flights yet or anything, but that's the current thoughts. It'll be fun to see Emil & things when I'm not horribly sick & unable to talk (unlike Christmas back in Indiana...), plus I've never actually been to California (yes! really!), so being all touristy should be cool. Of course, I first have to get there. Which might be a bigger issue than originally thought. At least if I fly certain airlines. Here's how one un-named (although you might figure it out if you look closely at the picture...) airline wants to route me: Yes, 13 hours. Portland to Oakland. Soooo, why is that a potential issue? Why is it so utterly insane? Here, maybe a map will help the less geographically inclined: Black line is the first leg, blue one is the second leg, and burgundy one is the third (final) leg. Thanks, but I think I'd rather save the time & just hop off the plane in San Francisco and swim across the bay. Or, I don't know...maybe drive down that nice orange live labeled "5"... Now playing: Jeremy Fisher – Goodbye Blue Monday – 01 Scar That Never Heals (sorry for the lyrics link...it's the best I could find while being lazy)
So I used to religiously backup my data...well, at least up until the last major hardware failure I had back in '06, at which point I discovered that it didn't really matter because the "important" data that I was backing up wasn't enough to fully recover. So I just switched to buying reliable equipment, which has worked out much better. Unfortunately it means that in 10 years I wont be able to come back and spend a week distracting myself by popping CD's in & out, reminiscing... ANYWAY, while digging through those backups (& slating them for destruction), I came across a bunch of photos from high school Spring Break (2001), when my family went down to Clearwater, Florida for the week. So here's the album (sorry for the low resolutions!): Heh…okay, so I was already a geek back then, and only took pictures of the day we spent at Kennedy Space Center, and didn't take any of the beach...or Busch Gardens...or...well, Florida itself... Now playing: Julie Fader – Outside In – 08 Goodbye Before Hello
Clearing out a couple months accumulation of things...my excuse for so few is "the holidays"... Now playing: Brandi Carlile – Give Up The Ghost – 08 I Will
Waaaay back, right after graduating from high school, I went to Europe with my French class from high school. Unfortunately, I didn't have a digital camera yet at that point, so all the pictures had to be scanned. While digging around, I found the scans of those pictures, so after a bit of cleaning up, here they are! Now playing: The Awkward Stage – Slimming Mirrors, Flattering Lights – 07 Only Good Days Caught on Camera (okay, so that's not actually the song I'm listening too...actually, it's 11 I Hurt the Ones That Love Me, but the title of track 7 seemed more appropriate for a picture post) (i.e., putting in all (2) the links took longer than I was planning...)
I wish there was a way in Windows Live Photos to let me get an RSS feed of the albums, not just the photos within an album... (they're in order of date taken, not necessarily date posted...yeah, I need to be better about posting things on time...) Now playing: You Say Party! We Say Die! – XXXX – 10 Heart of Gold
|
About the author

Jeffrey Stults is a software developer currently in Portland, Oregon. He is contactable at:
stultsj@ntldr.net
Archive
| | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 31 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
Disclaimer
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.
© Copyright
2012
Jeffrey Stults, Jr.
Statistics
Total Posts: 256 This Year: 0 This Month: 0 This Week: 0 Comments: 23
Utilities
Pick a theme:
Sign In
|