RedirectMatch how to match any words but not index and nothing
snippet in htaccess

RedirectMatch how to match any words but not index and nothing

user5070

RewriteCond %{THE_REQUEST} \s(/folder/[\w-]+)\.php[?\s] [NC]
RewriteRule ^ %1/ [L,R=301]