Tag Archives: Apache

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 !

 

How to enable mod_rewrite in Apache?

To enable it the rewrite module, run “apache2 enable module rewrite”:

You need to restart the webserver to apply the changes:

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit/etc/apache2/sites-available/default:

 

After such a change, you need to restart Apache again.

Ref: http://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache