summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-10-09 02:22:39 +0200
committermh <mh@immerda.ch>2011-10-09 02:22:39 +0200
commit811928eed982bd18776e6abfe0b5e1b9864d7c55 (patch)
treec50993d8215318883f4c29e30555caeedcab3b64
parentc5f89ba130e2027a37d821d803da018583009f69 (diff)
we need these rewrite rules, otherwise it won't work with cgi
-rw-r--r--manifests/vhost/php/mediawiki.pp2
-rw-r--r--templates/vhosts/php_mediawiki/partial.erb16
2 files changed, 17 insertions, 1 deletions
diff --git a/manifests/vhost/php/mediawiki.pp b/manifests/vhost/php/mediawiki.pp
index 376f1be..502af53 100644
--- a/manifests/vhost/php/mediawiki.pp
+++ b/manifests/vhost/php/mediawiki.pp
@@ -52,7 +52,7 @@ define apache::vhost::php::mediawiki(
$mod_security_additional_options = 'absent',
$ssl_mode = false,
$vhost_mode = 'template',
- $template_partial = 'apache/vhosts/php/partial.erb',
+ $template_partial = 'apache/vhosts/php_mediawiki/partial.erb',
$vhost_source = 'absent',
$vhost_destination = 'absent',
$htpasswd_file = 'absent',
diff --git a/templates/vhosts/php_mediawiki/partial.erb b/templates/vhosts/php_mediawiki/partial.erb
new file mode 100644
index 0000000..38f9663
--- /dev/null
+++ b/templates/vhosts/php_mediawiki/partial.erb
@@ -0,0 +1,16 @@
+<% if run_mode == 'fcgid' -%>
+ RewriteEngine On
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
+ RewriteRule ^/?index.php/(.*)$ /index.php?title=$1 [PT,L,QSA]
+<% end -%>
+<%= scope.function_template('apache/vhosts/php/partial.erb') %>
+ <Directory "<%= documentroot %>/typo3/">
+ RewriteEngine on
+
+ # Rewrite URLs to https that go for the admin area
+ RewriteCond %{REMOTE_ADDR} !^127\.[0-9]+\.[0-9]+\.[0-9]+$
+ RewriteCond %{HTTPS} !=on
+ RewriteCond %{REQUEST_URI} (.*/typo3/.*)
+ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
+ </Directory> \ No newline at end of file