Ojs-3.1.1 remove index.php friendly url mode_rewrite not working

I am trying to remove index.php from the url but i get too many redirects error and 404 error.
Here is my .htaccess script:

RewriteEngine On
#RewriteBase /
RewriteRule ^index.php/$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/hsmj/ index.php/$1 [QSA,L]
##RewriteBase /
#
## Remove index.php
#RewriteCond %{SERVER_NAME} ^healthsystemsmanagementjournal.com
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ index.php/$1 [L]

# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteRule ^(.*)$ index.php/$1 [QSA,NC,L]
</IfModule>

The situation seems like OJS turning restful_ur to “on”, removes the /index.php/ part of url, then apache mod_rewrite passes requests to /index.php/ BUT OJS somehow removes it again on the server and the process loops. Seems to me this feature is not working.
The implementation of RESTFUL URL on OJS needs to be adjusted.

I stand to be corrected. thats just my assumption.

I am having the same issue. Should I try or is it broken?
I am running OJS 3.1.1.4.

Just adding to the information. If you are using OJS the apache SSL secure mode. These rules must be applied on VirtualHost *:443 and not on port 80.