Permission denied issue with simplesamlphp library and symbol link / Drupal 8

I just remembered an issue I was facing but had not found much documentation for. I was setting up the simplesamlphp library by creating a symbolic link to the library from the docroot. However I was constantly running into an "Permission denied" or Access Denied error. Can't remember the exact language but it was basically a 403 of some kind. And it only happened as I tried to login and you get redirected to this url: /simplesaml/module.php/saml/sp/saml2-acs.php/default-sp

Well after some digging I realized the htaccess file for Drupal 8 has a bug. As of the time of this writing it is on line 155 and looks like this:

  RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]

Basically what the issue is that regex is not correct. It matches for too many unrelated strings. So for whatever it matched simplesaml/module.php/saml/sp/saml2-acs.php/default-sp

 

The rule will function properly when rewritten as:

  RewriteRule "^(.+/.*|autoload)\.php($|//)" - [F]

 

Hopefully that helps if you're running into this.