Module disabled
Your Apache2 probably does not have the Rewrite module enabled.
Type ls /etc/apache2/mods-available/ | grep rewrite
and check if rewrite.load appears, if it means that the rewrite module is already installed and just enable it, enter the following:
a2enmod rewrite # Ativar o módulo
service apache2 restart # Reiniciar o servidor
If a rewrite.load did not appear when you gave ls /etc/apache2/mods-available/ | grep rewrite
then mod_rewrite is not installed, look for how to install mod_rewrite on Linux mint (probably it should be the same as Ubuntu)
AllowOverride
Now we have to tell Apache2 to allow changes, through AllowOverride . Navigate to the Apache2 sites directory
cd /etc/apache2/sites-enabled/
type ls
and see which site you want to edit, probably will be 000-default.conf . Assuming that this is the name:
mcedit 000-default.conf
(Replace mcedit with your favorite editor such as nano, gedit, or geany).
And edit all AllowOverride to AllowOverride All if you do not have any AllowOverride in the 000-default.conf edit the file /etc/apache2/apache2.conf
and look for something like this:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
And substitute this way:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Prevent the .htaccess from giving 500 error
You can prevent error 500 by changing your .htaccess file to only do the actions if the rewrite module is enabled, so change your .htaccess file like this:
# Checar se o modulo esta ativado
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
</IfModule>