Wednesday, 21 May 2014

.htaccess: Invalid command 'RewriteEngine'

Nice Apache error here found in /var/log/apache2/error.log on a wordpress site.

Rewriting is used quite frequently in frameworks to make the URL that the user can see look nice and friendly even though under the covers they do not actually point to separate pages. This was a new server and clearly this module was not enabled by default. Simply run:

sudo a2enmod rewrite

and then

sudo service apache2 restart

And you should be away again....
Post a Comment