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 2011/10/01 01:16:01 UTC

DO NOT REPLY [Bug 51933] New: Apply RewriteCond to RewriteBase, allow multiple RewriteBase by regexp

https://issues.apache.org/bugzilla/show_bug.cgi?id=51933

             Bug #: 51933
           Summary: Apply RewriteCond to RewriteBase, allow multiple
                    RewriteBase by regexp
           Product: Apache httpd-2
           Version: 2.3.12-beta
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: kenney@apache.org
    Classification: Unclassified


Having RewriteCond apply to a following RewriteBase combined with regular
expressions or lists for RewriteBase allows the same .htaccess file to be
used on development, test and live environments.

Assuming this is not otherwise possible, here is an example of purpose:

RewriteCond would allow to check for the url or server name to determine
the appropriate environment. For example, the development machine uses
http://localhost/domain.com/foo/, whereas the live environment would
use http://domain.com/foo/, resulting in two different RewriteBase values.
Ofcourse, this can be handled by build systems, but scripted websites
typically don't require those.

Thanks in advance!

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

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


DO NOT REPLY [Bug 51933] Apply RewriteCond to RewriteBase, allow multiple RewriteBase by regexp

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51933

--- Comment #1 from Kenney Westerhof <ke...@apache.org> 2011-09-30 23:19:34 UTC ---
Just to go into a little more detail: 

Having:

RewriteBase /foo
RewriteBase /domain.com/foo

and internally matching the longest one would be sufficient - the RewriteCond
then is not absolutely necessary. 
A workaround would be to have this prepended to every regular expression
in the file, voiding the purpose of having RewriteBase in the first place.

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

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


DO NOT REPLY [Bug 51933] Apply RewriteCond to RewriteBase, allow multiple RewriteBase by regexp

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51933

Stefan Fritsch <sf...@sfritsch.de> changed:

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

--- Comment #2 from Stefan Fritsch <sf...@sfritsch.de> 2011-10-09 14:17:58 UTC ---
If you start httpd on the development machine with -DDEVEL, this should already
work:

<IfDefine DEVEL>
RewriteBase /domain.com/foo
</IfDefine>
<IfDefine !DEVEL>
RewriteBase /foo
</IfDefine>

Therefore I don't see much value in allowing several RewriteBase directives and
I will mark this issue as WONTFIX.

FWIW, it may be that the %{CONTEXT_PREFIX} variable available in 2.3.x already
allows a more elegant solution. Also, there are some plans to make RewriteBase
unneccessary in many cases, but this will take some time until it is
implemented (probably 2.4.x with x > 0).

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

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