Fix this .htaccess

Job ID: 31091469

Budget: €8 – €30 EUR

I cannot figure out where the bug lies in this .htaccess file. (file attached)
The need is to hide from the url any 1st level subdirectory and the relative file extension.

So if a user types: "example.com/webpage" he/she can see what is actually stored in "https://www.example.com/directory/webpage.html".

What I achieved to do for the moment is to either hide the extension, or hide the subdirectory, but not both at the same time. These rules have some conflict that I am not currently able to solve and so I am asking for your help!

If you have any question feel free to ask, I'd like to give away the job by the end of today, so first comes first served.

Cheers
Related categories: Apache