From 97186c0361ddaba8a10534d89ab852aff3c726e5 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 11 Nov 2014 22:02:40 +0100 Subject: [PATCH] Webserver\Apache2: show hint with no mod_rewrite This is yet unstyled, but still far better than 500 fixes #7643 --- .../Icinga/Web/Setup/Webserver/Apache2.php | 22 +++++++++++++------ public/error_norewrite.html | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 public/error_norewrite.html diff --git a/library/Icinga/Web/Setup/Webserver/Apache2.php b/library/Icinga/Web/Setup/Webserver/Apache2.php index 767e9a882..f878a23e8 100644 --- a/library/Icinga/Web/Setup/Webserver/Apache2.php +++ b/library/Icinga/Web/Setup/Webserver/Apache2.php @@ -38,13 +38,21 @@ Alias {webPath} "{publicPath}" EnableSendfile Off - RewriteEngine on - RewriteBase {webPath}/ - RewriteCond %{REQUEST_FILENAME} -s [OR] - RewriteCond %{REQUEST_FILENAME} -l [OR] - RewriteCond %{REQUEST_FILENAME} -d - RewriteRule ^.*$ - [NC,L] - RewriteRule ^.*$ index.php [NC,L] + + RewriteEngine on + RewriteBase {webPath}/ + RewriteCond %{REQUEST_FILENAME} -s [OR] + RewriteCond %{REQUEST_FILENAME} -l [OR] + RewriteCond %{REQUEST_FILENAME} -d + RewriteRule ^.*$ - [NC,L] + RewriteRule ^.*$ index.php [NC,L] + + + + DirectoryIndex error_norewrite.html + ErrorDocument 404 /error_norewrite.html + + EOD; diff --git a/public/error_norewrite.html b/public/error_norewrite.html new file mode 100644 index 000000000..d85a00205 --- /dev/null +++ b/public/error_norewrite.html @@ -0,0 +1 @@ +

The rewrite module is not enabled