[Mailman-Users] Help with a regular expression

Greg Westin greg at gregwestin.com
Sun Jan 19 01:39:15 CET 2003


I don't know what the I or | or whatever that is does - I assume it  
does the same thing as {0,1}.  But the important difference between the  
rule I use:
	RewriteRule ^/(mailman[/]{0,1}){0,1}$    /mailman/listinfo [L,R]
and the ones you suggested is that mine also redirects requests for /  
to /mailman/listinfo.  You may or may not want that functionality, of  
course.  Again, I don't claim to be an expert in any of this stuff...  
considering your comments, perhaps this would be the best for what I  
want to do:
	RewriteRule ^/(mailman(|/)){0,1}$ /mailman/listinfo [PT]
I don't know if you can use nested parentheses, and I don't know if the  
PT flag is something I'd want, but whatever works...

Greg

On Saturday, January 18, 2003, at 02:15  PM, Richard Barrett wrote:

> At 14:46 18/01/2003, Greg Westin wrote:
>> I think what you want to do to fix this is add a carat ("^") before  
>> the
>> first slash:
>> RedirectMatch ^/mailman[/]*$ http://www.example.com/mailman/listinfo
>>
>> That way, it only catches it if "/mailman" occurs at the beginning of
>> the string.
>>
>> Personally, I use a little more inclusive regular expression, because  
>> I
>> want it to also redirect any requests for the top level
>> (http://lists.example.com) to the listinfo page:
>>     RewriteRule ^[/]{0,1}(mailman[/]{0,1}){0,1}$    /mailman/listinfo
>> [L,R]
>
> What's wrong with:
>
>     RedirectMatch permanent ^/mailman(|/)$ /mailman/listinfo
>
> or, if you have mod_rewrite and the rewrite engine on:
>
>     RewriteRule ^/mailman(|/)$ /mailman/listinfo [R,L]
>
> or even better:
>
>     RewriteRule ^/mailman(|/)$ /mailman/listinfo [PT]
>
> The latter has the advantage, courtesy of the PT flag, of delivering  
> the /mailman/listinfo page immediately instead of making the browser  
> do a second request (each time it visits) to follow the redirection  
> response produced by the initial request, if that request's URI path  
> was /mailman or /mailman/
>
>> I claim to be no master of regular expressions, though... because wow
>> that looks ugly.  That notwithstanding, I think my advice on your
>> situation is correct.
>>
>> Greg
>>
>> On Saturday, January 18, 2003, at 02:09  AM, Paul Kleeberg wrote:
>>
>>> I know this is a simple question but I don't have the knowledge to
>>> figure it out.
>>>
>>> I am running RedHat 8.0 and which came with Mailman 2.0.13.  It
>>> suggests adding the following to the httpd.conf file:
>>>
>>> # Uncomment the following line, replacing www.example.com with your
>>> server's
>>> # name, to redirect queries to /mailman to the listinfo page
>>> (recommended).
>>> # RedirectMatch /mailman[/]*$ http://www.example.com/mailman/listinfo
>>>
>>> That used to work fine.  I just upgraded to Mailman 2.1.  I created
>>> the list "mailman" as instructed at the end of section 4 of the
>>> INSTALL document but cannot get to the administrative page
>>> http://www.example.com/mailman/admin/mailman or the list overview  
>>> page
>>> http://www.example.com/mailman/listinfo/mailman because
>>> "RedirectMatch" thinks it is http://www.example.com/mailman and just
>>> redirects it the top level listinfo page.
>>>
>>> I am aware that I have two options:
>>>   1. Rename the "mailman" list
>>>   2. Remove the "RedirectMatch" statement from the httpd.conf file.
>>>
>>> Is there a third?  I tried fiddling with the regular expression, but  
>>> I
>>> just do not know what I am doing.  Any help would be appreciated.
>>>
>>> Paul
>>> --
>>> Paul Kleeberg, M.D.              O   o          paul at fpen.org
>>> Family Physicians' E-Net        -+---+-   Voice: 612-840-3744
>>> 5025 Mulcare Drive               |_o_|      Family Practice &
>>> Columbia Heights, MN 55421 USA  / \|/ \  Information Services
>>>
>>> ------------------------------------------------------
>>> Mailman-Users mailing list
>>> Mailman-Users at python.org
>>> http://mail.python.org/mailman/listinfo/mailman-users
>>> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
>>> Searchable Archives:
>>> http://www.mail-archive.com/mailman-users%40python.org/
>>>
>>> This message was sent to: greg at gregwestin.com
>>> Unsubscribe or change your options at
>>> http://mail.python.org/mailman/options/mailman-users/  
>>> greg%40gregwestin.com
>> --
>> http://www.gregwestin.com
>> Contact info: http://www.gregwestin.com/contact.php
>>
>>
>> ------------------------------------------------------
>> Mailman-Users mailing list
>> Mailman-Users at python.org
>> http://mail.python.org/mailman/listinfo/mailman-users
>> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
>> Searchable Archives:  
>> http://www.mail-archive.com/mailman-users%40python.org/
>>
>> This message was sent to: r.barrett at openinfo.demon.co.uk
>> Unsubscribe or change your options at
>> http://mail.python.org/mailman/options/mailman-users/ 
>> r.barrett%40openinfo.demon.co.uk
>
>
> ------------------------------------------------------
> Mailman-Users mailing list
> Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
> Searchable Archives:  
> http://www.mail-archive.com/mailman-users%40python.org/
>
> This message was sent to: greg at gregwestin.com
> Unsubscribe or change your options at
> http://mail.python.org/mailman/options/mailman-users/ 
> greg%40gregwestin.com
>
--
http://www.gregwestin.com
Contact info: http://www.gregwestin.com/contact.php




More information about the Mailman-Users mailing list