diff --git a/src/Fast404.php b/src/Fast404.php
index 8348432..0a498b0 100644
--- a/src/Fast404.php
+++ b/src/Fast404.php
@@ -104,6 +104,29 @@ class Fast404 {
       return;
     }
 
+    // Check for a language path prefix.
+    $lang_negotiation_url_info = \Drupal::config('language.negotiation')->get('url');
+    if (!empty($lang_negotiation_url_info['source']) && $lang_negotiation_url_info['source'] == 'path_prefix') {
+      // Separate the language path prefix if it exists.
+      $pos = strpos($path, '/', 1);
+      if ($pos !== FALSE) {
+        $prefix = substr($path, 1, $pos - 1);
+      }
+      else {
+        $prefix = substr($path, 1);
+      }
+      // If this string is one of the configured language prefixes, ignore it.
+      if (in_array($prefix, $lang_negotiation_url_info['prefixes'])) {
+        if ($pos !== FALSE) {
+          $path = substr($path, $pos);
+        }
+        else {
+          // This path is the front page for a language prefix.
+          return;
+        }
+      }
+    }
+
     // If we have a database connection we can use it, otherwise we might be
     // initialising it.
 
@@ -116,6 +139,13 @@ class Fast404 {
       return;
     }
 
+    // Check whether the path matches a URL alias (exact matches only).
+    $sql = "SELECT pid FROM {url_alias} WHERE :path = alias";
+    $result = Database::getConnection()->query($sql, array(':path' => $path))->fetchField();
+    if ($result) {
+      return;
+    }
+
     // Check the URL alias table for anything that's not a standard Drupal path.
     $sql = "SELECT pid FROM {url_alias} WHERE :alias = CONCAT('/', alias)";
     $result = Database::getConnection()->query($sql, array(':alias' => $path))->fetchField();
