diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 55233f32866..83cca4ad2ca 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1723,36 +1723,53 @@ function system_site_maintenance_mode() {
}
/**
- * Form builder; Configure Clean URL settings.
+ * Form builder; Configure clean URL settings.
*
* @ingroup forms
* @see system_settings_form()
*/
function system_clean_url_settings() {
- $form['clean_url'] = array(
- '#type' => 'radios',
- '#title' => t('Clean URLs'),
- '#default_value' => 0,
- '#options' => array(t('Disabled'), t('Enabled')),
- '#description' => t('This option makes Drupal emit "clean" URLs (i.e. without ?q=
in the URL).'),
- );
+ global $base_url;
- if (!variable_get('clean_url', 0)) {
- if (strpos(request_uri(), '?q=') !== FALSE) {
- drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
-
- $form['clean_url']['#description'] .= ' ' . t('Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The handbook page on Clean URLs has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) . '';
-
- $form['clean_url']['#disabled'] = TRUE;
- $form['clean_url']['#prefix'] = '
' . t('Run the clean url test.', array('@clean_url' => base_path() . 'admin/settings/clean-urls')) . '
example.com/user
instead of example.com/?q=user
.'),
+ );
+ $form = system_settings_form($form);
+ }
+ else {
+ drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
+
+ $form['#redirect'] = $base_url . '/admin/settings/clean-urls';
+ $form['clean_url_description'] = array(
+ '#type' => 'markup',
+ '#markup' => '' . t('Use URLs like example.com/user
instead of example.com/?q=user
.') . ' ' . t('If you are directed to a Page not found (404) error after testing for clean URLs, see the online handbook.', array('@handbook' => 'http://drupal.org/node/15365')) . '