diff --git a/.htaccess b/.htaccess index 1e08407..ea4091e 100644 --- a/.htaccess +++ b/.htaccess @@ -115,6 +115,10 @@ DirectoryIndex index.php index.html index.htm RewriteCond %{REQUEST_URI} !core RewriteRule ^ %1/core/%2 [L,QSA,R=301] + # Rewrite the install.php to check during installation if + # the mod_rewrite is working + RewriteRule ^core/install.php core/install.php?rewrite=ok [QSA,L] + # Pass all requests not referring directly to files in the filesystem to # index.php. Clean URLs are handled in drupal_environment_initialize(). RewriteCond %{REQUEST_FILENAME} !-f diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 9d98678..7e78a88 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -16,7 +16,7 @@ * An array of system requirements. */ function system_requirements($phase) { - global $base_url; + global $base_url, $install_state; $requirements = array(); // Ensure translations don't break during installation. $t = get_t(); @@ -55,6 +55,13 @@ function system_requirements($phase) { 'value' => $software, ); + // Test Clean URL support + if ($phase == 'install' && $install_state['interactive'] && !isset($_GET['rewrite'])) { + $requirements['rewrite_module']['title'] = $t('Clean URLs'); + $requirements['rewrite_module']['value'] = $t('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.', array('@link' => 'http://drupal.org/node/15365')); + $requirements['rewrite_module']['severity'] = REQUIREMENT_ERROR; + } + // Test PHP version and show link to phpinfo() if it's available $phpversion = phpversion(); if (function_exists('phpinfo')) {