I implemented the following code to redirect my urls
To externally redirect /dir/foo.php to /dir/foo/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+).php [NC]
RewriteRule ^ %1 [R,L]
To internally redirect /dir/foo/ to /dir/foo.php
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule .*?/?$ $1.php [L]
aapanel is by default adds slash to directory , this makes an issue for those files has a directory with same name
i tired to add this line DirectorySlash Off but it is not working , any suggestion how to turn off this ?