Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration

Apache shows this error message when you don’t have mod_rewrite enabled. To enable it follow below steps

1. cd to apache2 (usually in cd /etc/apache2 )

2. enter this command – sudo a2enmod rewrite

3. now restart the apache service – sudo service apache2 restart

That’s it !