Different URL PATTERNS per virtual host?
![](https://secure.gravatar.com/avatar/7a17c935b554c9f972ffe416e1a01ac6.jpg?s=120&d=mm&r=g)
I am using Mailman v2.1.6 and I was wondering whether it is possible to have a different DEFAULT_URL_PATTERN per virtual host?
For my main site, example.com, I would like it to use https://%s/mailman for the web interface, but for other sites I host, say example.net, to use http://%s/mailman.
Take care,
Ben
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Benjamin Donnachie wrote:
I am using Mailman v2.1.6 and I was wondering whether it is possible to have a different DEFAULT_URL_PATTERN per virtual host?
Not without running a different copy of Mailman for the different hosts.
For my main site, example.com, I would like it to use https://%s/mailman for the web interface, but for other sites I host, say example.net, to use http://%s/mailman.
DEFAULT_URL_PATTERN is used both at list creation time to create the list's web_page_url attribute and it is also used by a utility function that returns various URLs when the function is called without a web_page_url argument.
Were it not for the second usage, you could simply set (or default)
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
and then use bin/withlist or bin/config_list to set web_page_url to 'https://example.com/mailman/' for the lists in the example.com domain. However, because of the second usage of DEFAULT_URL_PATTERN, this will only be partially (and not very) effective.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/7a17c935b554c9f972ffe416e1a01ac6.jpg?s=120&d=mm&r=g)
Benjamin Donnachie wrote:
I am using Mailman v2.1.6 and I was wondering whether it is possible to have a different DEFAULT_URL_PATTERN per virtual host?
I decided to cheat by sticking the following in the apache config for my sites:
RewriteRule ^/mailman/(.*) https://www\.py-soft\.co\.uk/mailman/$1 [L,R=permanent]
Seems to work! :)
Ben
![](https://secure.gravatar.com/avatar/7a17c935b554c9f972ffe416e1a01ac6.jpg?s=120&d=mm&r=g)
Benjamin Donnachie wrote:
RewriteRule ^/mailman/(.*) https://www\.py-soft\.co\.uk/mailman/$1 [L,R=permanent] Seems to work! :)
Ah... no it doesn't! Ah well...
Ben
participants (2)
-
Benjamin Donnachie
-
Mark Sapiro