You have enabled the rewrite module of Apache, you have also added the respective lines in the configuration files of Apache, of the website on which you want to apply the rewriting, however it doesn't work at the end.
The common issue here is that you have let this line :
<Directory /path/to/files>
Whereas it should be :
<Directory /var/www/domainname.com/public_html/>
Restart Apache, now it should be ok.
Note: Commissions may be earned from the links above.
This page contains references to products from one or more of our advertisers. We may receive compensation when you click on links to those products. For an explanation of our advertising policy, please visit this page.