diff --git a/lib/contentful_rails/preview.rb b/lib/contentful_rails/preview.rb
index <HASH>..<HASH> 100644
--- a/lib/contentful_rails/preview.rb
+++ b/lib/contentful_rails/preview.rb
@@ -15,8 +15,8 @@ module ContentfulRails
         return
       end
 
-      #check subdomain matches the configured one
-      if request.subdomain == ContentfulRails.configuration.preview_domain
+      #check subdomain matches the configured one - we assume it's first sub.domain.in.the.array
+      if request.subdomains.first == ContentfulRails.configuration.preview_domain
         authenticated = authenticate_with_http_basic  do |u,p|
           u == ContentfulRails.configuration.preview_username
           p == ContentfulRails.configuration.preview_password
Always use the first subdomain to determine whether this is the preview domain or now