diff --git a/apachesolr_search.module b/apachesolr_search.module
index 1ca1d66..8581ec3 100644
--- a/apachesolr_search.module
+++ b/apachesolr_search.module
@@ -1390,9 +1390,16 @@ function apachesolr_search_preprocess_search_results(&$variables) {
     pager_default_initialize($total, $params['rows']);
     $variables['pager'] = theme('pager', array('tags' => NULL));
 
-    // Add template hints for search pages.
-    $page_id = $variables['search_page']->page_id;
-    $variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'] . '__' . $page_id;
+    // Add template hints for environments
+    if (!empty($env_id)) {
+      $variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'] . '__' . $env_id;
+      // Add template hints for search pages
+      if (!empty($variables['search_page']->page_id)) {
+        $variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'] . '__' . $variables['search_page']->page_id;
+        // Add template hints for both
+        $variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module'] . '__' . $env_id . '__' . $variables['search_page']->page_id;
+      }
+    }
   }
 }
 
