moinsetup

Changeset

74:a95b3bd8f4e5
2013-09-08 Paul Boddie raw files shortlog changelog graph Added workarounds for question marks in page names to the .htaccess deployment method configuration.
moinsetup.py (file)
     1.1 --- a/moinsetup.py	Tue Feb 26 01:08:13 2013 +0100
     1.2 +++ b/moinsetup.py	Sun Sep 08 00:13:51 2013 +0200
     1.3 @@ -76,11 +76,29 @@
     1.4  # If a DirectoryIndex directive is also desired, the Indexes option must be set.
     1.5  # Such a directive is not desirable where the static and dynamic resources are
     1.6  # in different places, however.
     1.7 +#
     1.8 +# The first three blocks of conditions and rules are used to work around a bug
     1.9 +# in mod_rewrite, supporting up to three question marks in URL paths.
    1.10 +# See: http://moinmo.in/MoinMoinBugs/CannotAccessPagesEndingWithAQuestionMark
    1.11 +# See: https://issues.apache.org/bugzilla/show_bug.cgi?id=49642
    1.12  
    1.13  apache_htaccess_combined_mod_rewrite = """\
    1.14  DirectoryIndex %(url_path_tr)s/moin.cgi/
    1.15  RewriteEngine On
    1.16  RewriteBase %(final_url_path)s
    1.17 +
    1.18 +RewriteCond %%{REQUEST_FILENAME} !-f
    1.19 +RewriteCond %%{REQUEST_FILENAME} !-d
    1.20 +RewriteRule ^(.*)\?(.*)\?(.*)\?(.*) %(url_path_tr)s/moin.cgi/$1\%3f$2\%3f$3\%3f$4 [PT,L,QSA]
    1.21 +
    1.22 +RewriteCond %%{REQUEST_FILENAME} !-f
    1.23 +RewriteCond %%{REQUEST_FILENAME} !-d
    1.24 +RewriteRule ^(.*)\?(.*)\?(.*) %(url_path_tr)s/moin.cgi/$1\%3f$2\%3f$3 [PT,L,QSA]
    1.25 +
    1.26 +RewriteCond %%{REQUEST_FILENAME} !-f
    1.27 +RewriteCond %%{REQUEST_FILENAME} !-d
    1.28 +RewriteRule ^(.*)\?(.*) %(url_path_tr)s/moin.cgi/$1\%3f$2 [PT,L,QSA]
    1.29 +
    1.30  RewriteCond %%{REQUEST_FILENAME} !-f
    1.31  RewriteCond %%{REQUEST_FILENAME} !-d
    1.32  RewriteRule ^(.*) %(url_path_tr)s/moin.cgi/$1 [PT,L,QSA]