Eli Barzilay wrote:
On Jun 3, Mark Sapiro wrote:
Eli Barzilay wrote:
Is there a way to change mailing list URLs from ...something.../<verb>/<list> to ...something.../<list>/<verb> ?
[...]
If you could figure out a way within Apache to redirect URLs of the form
...something.../<list>/<verb>
to
...something.../<verb>/<list>
without then turning around and redirecting the second back to the first in an endless loop,
That's easy:
ScriptAliasMatch "^/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"Or replace that "[a-z]+" with "admin|admindb|confirm|...".
Yes, although I think that
ScriptAliasMatch "^/mailman/([a-z-]+/)([a-z]+)(/?.*)$"
"/usr/lib/mailman/cgi-bin/$2/$1$3"
is probably a bit closer.
it would still only partially work because posting of forms would not work because the form data would get lost in the redirect. Perhaps this is what you meant by "in addition it seems that it messes up the authentication somehow"
I *think* that the main thing that gets lost in the process is mailman making its own assumptions about the shape of the URLs: that it basically gives me a cookie that is valid for for http://<server>/admindb/<list> so when I refresh the page at the different URL, it asks me again to authenticate since I don't have the cookie. This is, of course, related to the fact that generated pages still have the wrong URLs on them. If there was some single function somewhere that constructs these URLs I think that I could make it work -- but I don't want to risk changes for code that I have no clue about...
You are touching on the problem. The generated URLs including the POST action URLs are generated as mailman/cgi_name/list_name... which doesn't work because it gets mapped to /usr/lib/mailman/cgi-bin/list_name/cgi_name... by the ScriptAliasMatch.
Changing the GetScriptURL method in Mailman/MailList.py to the following
def GetScriptURL(self, scriptname, absolute=0):
return re.sub('/([^/]*$)', '/' + self.internal_name() + r'/\1',
Utils.ScriptURL(scriptname, self.web_page_url, absolute))
Seems to work for the admin interface, and will work for more but I won't guarantee it will work for everything.
[...]
[
BTW, it just happens (really by accident) that someone pointed me at http://www.w3.org/Provider/Style/URI today -- it's a good summary of what bugs me with the default mailman url scheme: "pipermail" is related to the implementation of the archiver,
"pipermail" in public archive URLs exists only in the web server
Alias /pipermail/ /usr/local/mailman/archives/public/
and the Defaults.py setting
PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/pipermail/%(listname)s'
It's easily changed to anything you like.
and the <verb>/<list> thing is something that after 5 years of moderating about 10 lists I still can't remember. It's especially bad with links like:
http://<host>/admin/<list>/members?letter=a
where the verb is on one side of the list name, and the arguments are on the other side. It seems much better to me to think about the interfaces as being part of the list. It would even work better with URL completion...
]
Join the mailman-developers@python.org list; see the thread at <http://mail.python.org/pipermail/mailman-developers/2010-June/021093.html>, and join the discussion.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan