/filename.php becomes /filename - Fail
/filename.php/ becomes /filename.php - Fail!
/filename/ becomes filename - success!
How would I remove the extension on the scenario that has the trailing slash?
Options +MultiViews
RewriteEngine On
# remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s(.+?)/+[?\s]
RewriteRule ^(.+?)/$ /$1 [R=301,L]
# remove php/html extension
RewriteCond %{THE_REQUEST} /index\.(php|html)[\s/?] [NC]
RewriteCond %{REQUEST_URI} !/system/ [NC]
RewriteRule ^(.*?)index\.(?:php|html)(.*)$ $1$2 [R=301,NE,L]
filename.phpwould redirect tofilenamebecause your rule checks for*index.(php|html)*. What exactly are you trying to accomplish here? Please be more specific, as your question says one thing, but your code says another.