diff --git a/index-wp-redis.php b/index-wp-redis.php
index 55899d271be47457ec3af2f719d8138af20210ac..8676ce68c5ef7f39cc967933f29f0c24ade1939a 100644
--- a/index-wp-redis.php
+++ b/index-wp-redis.php
@@ -23,8 +23,11 @@ $secret_string       = "changeme";
 if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
     $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
 }
+ 
+if(!defined('WP_USE_THEMES')) {
+    define('WP_USE_THEMES', true);
+}
 
-define('WP_USE_THEMES', true);
 $current_url = str_replace(array("?refresh=${secret_string}","&refresh=${secret_string}"), '', "http://${_SERVER['HTTP_HOST']}${_SERVER['REQUEST_URI']}"); //clean up the URL
 $redis_key = md5($current_url);