Enabling mod_rewrite on Ubuntu
Ubuntu by default, doesn't have mod_rewrite enabled. This prevents any rewriting done in a .htaccess file from working. To enable it:
sudo a2enmod rewrite
Then change the default config file's AllowOverride value to "all":
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options FollowSymLinks
AllowOverride all
Order allow,deny
allow from all
</Directory>