Looks like the "$1"'s were stripped when sourceforge emailed out my comment.
The correct rule should be: RewriteCond $1 !^/wk RewriteRule ^(.*)$ /wk$1 [L,PT] > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > SourceForge.net > Sent: Sunday, February 22, 2004 1:11 PM > To: [EMAIL PROTECTED] > Subject: [Webware-devel] [ webware-Bugs-902242 ] URLParser messes up > 301s through mod_rewrite > > > Bugs item #902242, was opened at 2004-02-22 11:34 > Message generated for change (Comment added) made by benparker > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=104866&aid=90224 > 2&group_id=4866 > > Category: WebKit > Group: None > Status: Open > Resolution: None > Priority: 5 > Submitted By: Nobody/Anonymous (nobody) > Assigned to: Nobody/Anonymous (nobody) > Summary: URLParser messes up 301s through mod_rewrite > > Initial Comment: > > I've been porting my site to WK CVS. I've found one > issue with the combination of mod_rewrite rules and the > new URLParser class. I am doing the standard /wk/ > rewrite for the top level: > RewriteRule ^(.*) /wk/ [L,PT] > > Now, say that I have a servlet at > http://example.com/directory/index (in reality > in /wk/directory/index). If I request: > http://example.com/directory/ everything works fine. If > instead though, I do an http://example.com/directory > (no trailing slash), the URLParser class (line 450 or so), > does this: > raise HTTPMovedPermanently > (webkitLocation=trans.request().urlPath() + "/") > > That though sends to the client a 301 with a new > location of http://example.com/wk/directory/ which in > turn Apache changes into > http://example.com/wk/wk/directory/ which finally > raises a 404. > > Changing the above URLParser line to: > raise HTTPMovedPermanently(location=trans.request > ().urlPath() + "/") > > fixes the problem, but I am not sure if that will break > other configs. > > > > ---------------------------------------------------------------------- > > Comment By: Ben Parker (benparker) > Date: 2004-02-22 13:10 > > Message: > Logged In: YES > user_id=672635 > > Even under the 0.8.1 release, there are situations where a > double /wk can be prefixed by apache during a redirect. > > How about trying this rewrite rule instead: > > RewriteCond !^/wk > RewriteRule ^(.*)$ /wk [L,PT] > > Then you'll never have apache adding 2 "/wk" prefixes to the > URL, which I think is the real problem here. > > Regards, > Ben > > > ---------------------------------------------------------------------- > > Comment By: Costas Malamas (cmalamas) > Date: 2004-02-22 11:35 > > Message: > Logged In: YES > user_id=71233 > > Sorry, I wasn't logged in; this is [EMAIL PROTECTED] > > ---------------------------------------------------------------------- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=104866&aid=90224 2&group_id=4866 ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-devel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-devel