> -----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. > > -- > 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 > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. --------------------------------------------------------------------- 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