Bad detection of URL rewrite support

On Apache server with PHP 7.1 mode FastCGI is not rewrite support properly detected.

in /.htaccess is:

  <IfModule mod_env.c>
    SetEnv HTTP_MOD_REWRITE On
  </IfModule>
but in /include/library/lib_route.inc.php is only:

    // Detect URL rewrite support
      $use_rewrite = false;
      if (isset($_SERVER['REDIRECT_HTTP_MOD_REWRITE']) && in_array(strtolower($_SERVER['REDIRECT_HTTP_MOD_REWRITE']), array('1', 'active', 'enabled', 'on', 'true', 'yes'))) {
        $use_rewrite = true;
      } else if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) {
        $use_rewrite = true;
      } else if (!preg_match('#(apache)#i', $_SERVER['SERVER_SOFTWARE'])) {
        $use_rewrite = true; // We are just going to assume any non-apache HTTP daemon supports URL rewriting
      }
two possible solutions for me:

1) in /.htaccess
  <IfModule mod_env.c>
    SetEnv HTTP_MOD_REWRITE On
    SetEnv REDIRECT_HTTP_MOD_REWRITE On
  </IfModule>
OR

2)  in /include/library/lib_route.inc.php:
    // Detect URL rewrite support
      $use_rewrite = false;
      if (isset($_SERVER['REDIRECT_HTTP_MOD_REWRITE']) && in_array(strtolower($_SERVER['REDIRECT_HTTP_MOD_REWRITE']), array('1', 'active', 'enabled', 'on', 'true', 'yes'))) {
        $use_rewrite = true;
      } else if (isset($_SERVER['HTTP_MOD_REWRITE']) && in_array(strtolower($_SERVER['HTTP_MOD_REWRITE']), array('1', 'active', 'enabled', 'on', 'true', 'yes'))) {
        $use_rewrite = true;
      } else if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) {
        $use_rewrite = true;
      } else if (!preg_match('#(apache)#i', $_SERVER['SERVER_SOFTWARE'])) {
        $use_rewrite = true; // We are just going to assume any non-apache HTTP daemon supports URL rewriting
      }

Better solution?
I don't know the story why Apache adds the REDIRECT_ prefix. Does your installation cook them without the prefix? I vote for solution 2 if that solves your issue.
OK solution 2 solves my problem.

PHP running in FastCGI mode (mod_fastcgi) runs without "REDIRECT_" prefix
Only mod_cgi (and maybe mod_apache?) prepend "REDIRECT_" prefix
I do not know why.
http://httpd.apache.org/docs/current/custom-error.html#variables
That makes sense as it used to say HTTP_MOD_REWRITE and was recently changed to REDIRECT_HTTP_MOD_REWRITE thinking I got it wrong the first time.

For the next release I will make sure both are supported as of your example 2. I learned something new today :)
Amazing, you're the best ... thanks.