On Tue, December 12, 2006 1:22 am, Boyle Owen wrote: >> -----Original Message----- >> From: Richard Lynch [mailto:ceo@xxxxxxxxx] >> Sent: Tuesday, December 12, 2006 2:32 AM >> To: users@xxxxxxxxxxxxxxxx >> Subject: RewriteRule oddity >> >> I have a RewriteRule that works on all but one (1) input where I >> would >> expect it to work. >> >> Here is the site (currently very ugly, but functional): >> http://telephonebook.com/index.php >> >> The example redirect links all work. >> >> If you try it with '2' the re-direct behaves as expected: >> http://telephonebook.com/2 >> >> However, for some reason beyond my ken, using '1' does NOT redirect: >> http://telephonebook.com/1 > > First off, congratulations for posting your real, actual site - it > makes > de-bugging a breeze and I wish more people would do it (instead of > www.mydomain.com etc..). Anyway... > > The rewrite rule *is* working. Here is the (abbreviated) headers when > I > request http://telephonebook.com/1 (courtesy FireFox anf LiveHeaders > extension): > > GET /1 HTTP/1.1 > Host: telephonebook.com > > HTTP/1.x 302 Found > Location: http://telephonebook.com/index.php?number=1 > > GET /index.php?number=1 HTTP/1.1 > Host: telephonebook.com > > HTTP/1.x 302 > Location: http://1and1.com > > So you see that the first request is redirected to > /index.php?number=1, > but that this request returns with *another* redirect to > http://1and1.com. > > BTW, you can test this by requesting > http://telephonebook.com/index.php?number=1 directly. > > Looks like a bug in the PHP script... > > Rgds, > Owen Boyle > Disclaimer: Any disclaimer attached to this message may be ignored. > > > > > > > > > > > > >> >> The rewrite rule is not all that tricky: >> RewriteRule ^([0-9()-]+)([0-9()a-zA-Z-]*)$ >> /index.php?number=$1$2 [R,L] >> >> Why would '2' match that rule, but '1' would not? >> >> It's POSSIBLE that 1and1.com (the webhosts at the moment) have done >> something with their rewrite rules and ErrorDocument, which I can't >> even see much less edit. >> http://telephonebook.com/ab >> >> Hmmmmm. >> http://telephonebook.com/a >> doesn't do their 404 lookup either. >> >> So, like, that almost for sure proves that their rules are at fault, >> right?... >> >> I can't turn RewriteLogLevel on in .htaccess, so can't really debug >> this very easily :-( >> I get 500 Internal Server Error trying to do that. >> >> We'll probably move this over to a racked server so the issue may >> resolve itself once we are free of 1and1.com, but I wanted to >> confirm >> my thinking more than anything, since I'm not a mod_rewrite guru by >> any means. This is even more odd... Apparently, 1and1 have changed something (I sure haven't) and now /1 works, but their pre-defined rules for 404 docs still don't work for /a but work for /ab Thanks for checking it out! Just wish 1and1 wasn't changing things out from under me while I'm trying to debug it. :-v PS I actually wanted /1 to re-direct to 1and1.com homepage as an example, so now it's working fine... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx