DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20195>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20195

per-dir prefix stripping broken without trailing slash

           Summary: per-dir prefix stripping broken without trailing slash
           Product: Apache httpd-2.0
           Version: HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_rewrite
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Hi,

Say I have the following in my /DocRoot/foo/.htaccess:

  RewriteRule (.*) http://another.site/$1 [last,redirect=permanent]

According to the comments around line 1940 of mod_rewrite.c, the local prefix
should be stripped from the URI before matching against the pattern. Indeed,
http://my.site/foo/bar does get redirected to http://another.site/bar . However,
if one tries to access http://my.site/foo , the string comparison in the code
fails, resulting in the full path being matched against the pattern. i.e.
http://my.site/foo is redirected to http://another.site//DocRoot/foo .

A temporary fix is to special-case this condition in the rewrite rules:

  RewriteRule /DocRoot/foo http://another.site/ [last,redirect=permanent]

though this is hardly elegant.

Thanks,
/Liyang

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to