diff --git a/interface/web/sites/ajax_get_json.php b/interface/web/sites/ajax_get_json.php
index c115b17c6f352f68c873a46fe829d57e2c823849..913a81abf4ee3e1b8ff8a12be6fd79f362138f98 100644
--- a/interface/web/sites/ajax_get_json.php
+++ b/interface/web/sites/ajax_get_json.php
@@ -50,7 +50,7 @@ if($type == 'getservertype'){
 	$web_config = $app->getconf->get_server_config($server_id, 'web');
 	if(!empty($web_config['server_type'])) $server_type = $web_config['server_type'];
 	$json .= $server_type;
-	unset($webconfig);
+	unset($web_config);
 	$json .= '"}';
 }
 
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 31952c3c3ca6560bae375fa81a84c86894780dbc..a39e2080536befdf1ad7067f11fa0cab9609b006 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1254,6 +1254,11 @@ class apache2_plugin {
 			$crt_tmp_file = "/etc/letsencrypt/live/".$domain."/cert.pem";
 			$key_tmp_file = "/etc/letsencrypt/live/".$domain."/privkey.pem";
 			$bundle_tmp_file = "/etc/letsencrypt/live/".$domain."/chain.pem";
+			if(!is_dir("/etc/letsencrypt/live/".$domain)) {
+				$crt_tmp_file = "/etc/letsencrypt/live/www.".$domain."/fullchain.pem";
+				$key_tmp_file = "/etc/letsencrypt/live/www.".$domain."/privkey.pem";
+				$bundle_tmp_file = "/etc/letsencrypt/live/www.".$domain."/chain.pem";
+			}
 			$webroot = $data['new']['document_root']."/web";
 
 			//* check if we have already a Let's Encrypt cert
diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 25060962f30c6e9987aa27518843df072c778f69..849b8a93196c333f0665d0f619ded0de506785ef 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -1328,6 +1328,10 @@ class nginx_plugin {
 			//* TODO: check dns entry is correct
 			$crt_tmp_file = "/etc/letsencrypt/live/".$domain."/fullchain.pem";
 			$key_tmp_file = "/etc/letsencrypt/live/".$domain."/privkey.pem";
+			if(!is_dir("/etc/letsencrypt/live/".$domain)) {
+				$crt_tmp_file = "/etc/letsencrypt/live/www.".$domain."/fullchain.pem";
+				$key_tmp_file = "/etc/letsencrypt/live/www.".$domain."/privkey.pem";
+			}
 			$webroot = $data['new']['document_root']."/web";
 
 			//* check if we have already a Let's Encrypt cert