.htaccess file not working on Ubuntu 14.04 with apache2

.htaccess, apache, mod-rewrite, ubuntu, url-rewriting

Solution

From your information I can only guess ("doesn't work" isn't very specific). Most probably you did not enable mod_rewrite. Type in:

`a2enmod rewrite`

and restart Apache after:

`service apache2 restart`

Problem

My .htaccess file doesn't work on my Ubuntu 14.04 with Apache 2. This is my file: ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?pg=$1 ``` How do i solve my problem?

Original source