--- hosting_site.module	2010-07-21 17:41:20.000000000 +0200
+++ hosting_site.module.new	2010-07-21 17:40:35.000000000 +0200
@@ -138,7 +138,7 @@ function hosting_get_sites_by_status($pl
  * Retrieve a node based on the url
  */
 function hosting_get_site_by_url($url) {
-  $nid = db_result(db_query("SELECT n.nid FROM {node} n JOIN {hosting_site} h ON n.nid = h.nid WHERE n.title='%s' AND n.type = 'site' AND NOT (h.status=%d)", $url, $url, HOSTING_SITE_DELETED));
+  $nid = db_result(db_query("SELECT n.nid FROM {node} n JOIN {hosting_site} h  ON n.nid = h.nid LEFT JOIN {hosting_site_alias} ha ON h.vid = ha.vid WHERE (n.title = '%s' OR ha.alias = '%s') AND n.type = 'site' AND NOT (h.status = %d)", $url, $url, HOSTING_SITE_DELETED));
   if ($nid) {
     return node_load($nid);
   }
