You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/07/03 14:18:49 UTC

DO NOT REPLY [Bug 39950] New: - Cannot compare two variables

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=39950

           Summary: Cannot compare two variables
           Product: Apache httpd-2
           Version: 2.2.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: erik@urbanninja.se


It seems that it is currently not possible to compare two variables in a RewriteCond, e g
RewriteCond %{HTTP_HOST}  ^%{OTHER_VARIABLE}$
since the right side pattern cannot contain variables or back-references.

This is a major drawback, since it forces hardcoding.

The same problem appears in RewriteRule, where the left side pattern cannot include variables or back-
references.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39950] - Cannot compare two variables

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=39950


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




------- Additional Comments From rpluem@apache.org  2006-07-03 20:53 -------
This is because the regular expressions get compiled during configuration time.
Doing so during runtime (which would be required when we would allow
backreferences / variables to be contained in the regex) would hit performance
hard. At least for the RewriteCond case there are some workarounds (not sure how
much performance these regexs are eating):

RewriteCond %{HTTP_HOST}  ^%{OTHER_VARIABLE}$

can be replaced with

RewriteCond %{HTTP_HOST}%{OTHER_VARIABLE} ^(.*)\1$

Basicly you must always try to transform your "logical" comparison to one with
the variable parts on the left side and a static regex on the right side. This
may not be always possible or might result in very expensive regex's on the
right side.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org