diff --git a/www/_include.php b/www/_include.php
index 8a5bf9be0a84f234e47944b9065ac7ef459af2ca..b5f506fa47fafffd947f995c107c3e254a2e96bb 100644
--- a/www/_include.php
+++ b/www/_include.php
@@ -91,8 +91,9 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0
 
 set_error_handler('SimpleSAML_error_handler');
 
-$configdir = SimpleSAML\Utils\Config::getConfigDir();
-if (!file_exists($configdir.'/config.php')) {
+try {
+    SimpleSAML_Configuration::getInstance();
+} catch (Exception $e) {
     throw new \SimpleSAML\Error\CriticalConfigurationError(
         'You have not yet created the SimpleSAMLphp configuration files.'
     );