diff --git a/apachesolr.admin.inc b/apachesolr.admin.inc
index dd8bdac..115d756 100644
--- a/apachesolr.admin.inc
+++ b/apachesolr.admin.inc
@@ -159,10 +159,17 @@ function apachesolr_environment_edit_form(&$form_state, $environment = NULL) {
 
   $form['actions']['save'] = array(
     '#type' => 'submit',
+    '#redirect' => 'admin/settings/apachesolr/settings',
     '#validate' => array('apachesolr_environment_edit_validate'),
     '#submit' => array('apachesolr_environment_edit_submit'),
     '#value' => t('Save'),
   );
+  $form['actions']['save_edit'] = array(
+    '#type' => 'submit',
+    '#validate' => array('apachesolr_environment_edit_validate'),
+    '#submit' => array('apachesolr_environment_edit_submit'),
+    '#value' => t('Save and edit'),
+  );
   $form['actions']['test'] = array(
     '#type' => 'submit',
     '#validate' => array('apachesolr_environment_edit_validate'),
@@ -230,13 +237,24 @@ function apachesolr_environment_edit_submit($form, &$form_state) {
   }
   cache_clear_all('apachesolr:environments', 'cache_apachesolr');
   drupal_set_message(t('The %name search environment has been saved.', array('%name' => $form_state['values']['name'])));
-  $form_state['redirect'] = 'admin/settings/apachesolr/settings';
+
+  // for some reason $_GET was not sufficient.
+  if (isset($_REQUEST['destination'])) {
+    unset($_REQUEST['destination']);
+  }
+
+  if (isset($form_state['clicked_button']['#redirect'])) {
+    $form_state['redirect'] = array($form_state['clicked_button']['#redirect']);
+  }
+  else {
+    $form_state['redirect'] = array($_GET['q']);
+  }
 }
 
 function apachesolr_environment_edit_cancel($form, &$form_state) {
   // Ensures destination is an internal URL, builds "cancel" link.
-  if (isset($_GET['destination'])) {
-    $destination = $_GET['destination'];
+  if (isset($_REQUEST['destination'])) {
+    $destination = $_REQUEST['destination'];
   }
   else {
     $destination = 'admin/settings/apachesolr/settings';
diff --git a/apachesolr_search.admin.inc b/apachesolr_search.admin.inc
index 07868f7..7e8fa65 100644
--- a/apachesolr_search.admin.inc
+++ b/apachesolr_search.admin.inc
@@ -415,10 +415,17 @@ function apachesolr_search_page_settings_form(&$form_state, $search_page = NULL)
   // Button for the corresponding actions
   $form['actions']['submit'] = array(
     '#type' => 'submit',
-    '#value' => t('Save configuration'),
+    '#redirect' => 'admin/settings/apachesolr/search-pages',
+    '#value' => t('Save'),
+    '#submit' => array('apachesolr_search_page_settings_form_submit'),
+  );
+  $form['actions']['submit_edit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save and edit'),
     '#submit' => array('apachesolr_search_page_settings_form_submit'),
   );
 
+
   $form['actions']['cancel'] = array(
     '#type' => 'submit',
     '#value' => t('Cancel'),
@@ -532,8 +539,18 @@ function apachesolr_search_page_settings_form_submit($form, &$form_state) {
 
   // Saves our values in the database, sets redirect path on success.
   drupal_set_message(t('The configuration options have been saved for %page.', array('%page' => $form_state['values']['label'])));
-  $form_state['redirect'] = 'admin/settings/apachesolr/search-pages';
 
+  // for some reason $_GET was not sufficient.
+  if (isset($_REQUEST['destination'])) {
+    unset($_REQUEST['destination']);
+  }
+
+  if (isset($form_state['clicked_button']['#redirect'])) {
+    $form_state['redirect'] = array($form_state['clicked_button']['#redirect']);
+  }
+  else {
+    $form_state['redirect'] = array($_GET['q']);
+  }
   // Menu rebuild needed to pick up search path.
   menu_cache_clear_all();
   menu_rebuild();
diff --git a/tests/apachesolr_base.test b/tests/apachesolr_base.test
index 3100373..b8ea194 100644
--- a/tests/apachesolr_base.test
+++ b/tests/apachesolr_base.test
@@ -274,7 +274,7 @@ class DrupalSolrOfflineSearchPagesWebTestCase extends DrupalWebTestCase {
       'page_title' => 'Test Title',
       'search_path' => 'search/searchdifferentpath',
     );
-    $this->drupalPost($this->getUrl(), $edit, t('Save configuration'));
+    $this->drupalPost($this->getUrl(), $edit, t('Save'));
     $this->assertResponse(200);
     // Reset static var
     apachesolr_search_page_load('core_search', TRUE);
@@ -331,7 +331,7 @@ class DrupalSolrOfflineSearchPagesWebTestCase extends DrupalWebTestCase {
       'page_title' => 'Test Title',
       'search_path' => 'search/searchdifferentpath',
     );
-    $this->drupalPost($this->getUrl(), $edit, t('Save configuration'));
+    $this->drupalPost($this->getUrl(), $edit, t('Save'));
     $this->assertResponse(200);
     // Make sure the menu is recognized
     // Reset static var
