@Jack Dawson thank you for your help.
I found out that mod rewrite is disabled, and I enabled it, and restarted the server.
I also removed the # in #RewriteBase /.
Also, allowoverride is set to true? What am I doing wrong?
I fixed it by including the subdirectory name in RewriteBase
Never give a 0777 permission its prone to be hacked!!!!!