ENHANCEMENT Installer now has a fallback for mod_rewrite detection by setting an environment variable in .htaccess when "<IfModule mod_rewrite.c>" directive is satisfied

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@112973 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sharvey 2010-10-20 02:41:35 +00:00 committed by Sam Minnee
parent 84cbba8bed
commit fba76de203
2 changed files with 4 additions and 0 deletions

View File

@ -18,7 +18,9 @@ ErrorDocument 500 /assets/error-500.html
</IfModule>
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]

View File

@ -645,6 +645,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;
}