1.1 --- a/README.txt Sun Nov 03 14:52:17 2013 +0100
1.2 +++ b/README.txt Sun Nov 03 19:40:56 2013 +0100
1.3 @@ -235,7 +235,10 @@
1.4
1.5 The redirect.py script, apart from supporting identifier-to-page redirects,
1.6 also supports PDF page exports since the "doexportpage" action uses
1.7 -identifiers to indicate which page is to be exported.
1.8 +identifiers to indicate which page is to be exported. In an environment that
1.9 +uses .htaccess and mod_rewrite, the redirect.py script should also be deployed
1.10 +under a separate name (such as export.py) so that it can discover whether it
1.11 +should be exporting a page instead of just showing it.
1.12
1.13 The search.py script redirects search requests in a suitable form to the
1.14 MoinMoin "fullsearch" action.
2.1 --- a/config/mailmanwiki-redirect-htaccess Sun Nov 03 14:52:17 2013 +0100
2.2 +++ b/config/mailmanwiki-redirect-htaccess Sun Nov 03 19:40:56 2013 +0100
2.3 @@ -8,7 +8,7 @@
2.4
2.5 RewriteCond %{REQUEST_FILENAME} !-f
2.6 RewriteCond %{REQUEST_FILENAME} !-d
2.7 -RewriteRule ^pages/doexportpage.action /redirect.py [PT,L,QSA]
2.8 +RewriteRule ^pages/doexportpage.action /export.py [PT,L,QSA]
2.9
2.10 RewriteCond %{REQUEST_FILENAME} !-f
2.11 RewriteCond %{REQUEST_FILENAME} !-d
3.1 --- a/scripts/redirect.py Sun Nov 03 14:52:17 2013 +0100
3.2 +++ b/scripts/redirect.py Sun Nov 03 19:40:56 2013 +0100
3.3 @@ -16,6 +16,7 @@
3.4 # An empty string means that the wiki is anchored at the site root.
3.5
3.6 URL_PREFIX = ""
3.7 +EXPORT_SCRIPT = "/export.py"
3.8
3.9 # See the scripts/tiny.py program for similar code in a stand-alone program.
3.10
3.11 @@ -79,7 +80,7 @@
3.12 if pageid is None:
3.13 fail(pageid)
3.14
3.15 - export = script.endswith("/pages/doexportpage.action") and args.get("type", [""])[0] == "TYPE_PDF"
3.16 + export = (script.endswith(EXPORT_SCRIPT) or script.endswith("/pages/doexportpage.action")) and args.get("type", [""])[0] == "TYPE_PDF"
3.17
3.18 f = open(MAPPING_ID_TO_PAGE)
3.19 try: