Remove index.php from imported urls I made some migration of pretty old website to d8. And urls ported fine from latest WP version: 

/user1/article-name1
/user2/2009/article-about-something
/user3/2017/11/06/article-something


But from what I see in google many articles would be linked with index.php at the end i.e.:

/user1/article-name1/index.php
/user2/2009/article-about-something/index.php
/user3/2017/11/06/article-something/index.php


etc etc. Somehow WP could handle it (no traces of overrides in htaccess), but Drupal would not. 

Puzzled how to fix it with htaccess, preferably with 301 redirect. 

Thanks for your ideas!
Solved thanks to https://stackoverflow.com/questions/27907044/htaccess-rule-to-remove-index-php-from-the-end-of-my-urls

Modified part of Drupal's .htaccess. Important to add new rule before standard index rewrite:

# Remove trailing /index.php that comes from external links.
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php$ /$1 [L,R=302,NC,NE]

# Pass all requests not referring directly to files in the filesystem to
# index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]