Juninho Chr Juninho Chr - 1 year ago 60
Apache Configuration Question

.htaccess file not working on Ubuntu 14.04 with apache2

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?

Answer Source

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