I have not having any luck getting my .htaccess with mod_rewrite working. Basically all I am trying to do is remove \'www\' from \"http://www.example.com\" and \"https://ww
I had the same problem and this wasted my 5 hours to fix.
So In order to use mod_rewrite you can type the following command in the terminal:
a2enmod rewrite
Then restart your Apache.