From 945a28f33af568b48c38d8ec88f7013e0ae2e354 Mon Sep 17 00:00:00 2001 From: sharvey Date: Thu, 18 Nov 2010 05:08:12 +0000 Subject: [PATCH] MINOR Merged r112269 through r113912 from phpinstaller/branches/2.4 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@113914 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- .htaccess | 2 + assets/.htaccess | 36 +++++++++++++++++- assets/web.config | 97 +++++++++++++++++++++++++++++++++++++++++++++++ install.php | 14 ++++--- 4 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 assets/web.config diff --git a/.htaccess b/.htaccess index e8a3913..804c1ad 100644 --- a/.htaccess +++ b/.htaccess @@ -18,7 +18,9 @@ ErrorDocument 500 /assets/error-500.html + SetEnv HTTP_MOD_REWRITE On RewriteEngine On + RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] diff --git a/assets/.htaccess b/assets/.htaccess index ac6412a..4013417 100644 --- a/assets/.htaccess +++ b/assets/.htaccess @@ -1,2 +1,34 @@ -RemoveHandler .php .phtml .php3 .php4 .php5 .inc -RemoveType .php .phtml .php3 .php4 .php5 .inc +# +# Whitelist appropriate assets files. +# Note that you will need to maintain this whitelist yourself if you modify File::$allowed_extensions +# +# If you are not using Apache then you can ignore this file. +# If you are using IIS then you should look at assets/web.config instead. +# +# To add an extension to the list, you need to put another string of the form "ext|" on the +# FilesMatch line, inside the parentheses. +# +# For example, to add *.exe files to list of downloadable assets, change this line: +# +# + Allow from all + + +# We disable PHP via several methods +# Replace the handler with the default plaintext handler +AddHandler default-handler php phtml php3 php4 php5 inc + + + # Turn the PHP engine off + php_flag engine off + diff --git a/assets/web.config b/assets/web.config new file mode 100644 index 0000000..df26900 --- /dev/null +++ b/assets/web.config @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/install.php b/install.php index 46daa1d..7e4c5d3 100644 --- a/install.php +++ b/install.php @@ -659,6 +659,8 @@ class InstallRequirements { function testApacheRewriteExists($moduleName = 'mod_rewrite') { if(function_exists('apache_get_modules') && in_array($moduleName, apache_get_modules())) { return true; + } elseif(isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE'] == 'On') { + return true; } else { return false; } @@ -1224,17 +1226,19 @@ TEXT; window.location = "home/successfullyinstalled?flush=1"; }, 2000); } else { - $('#ModRewriteResult').html("Friendly URLs are not working. This is most likely because a rewrite module isn't configured" - + "correctly on your site. Please check the following things in your Apache configuration; " - + " you may need to get your web host or server administrator to do this for you:" - + ""); + $('#ModRewriteResult').html("Friendly URLs are not working. This is most likely because a rewrite module isn't configured " + + "correctly on your site. You may need to get your web host or server administrator to do this for you: " + + ""); } } }); } HTML; }