Several websites are down: Invalid command 'RewriteEngine'

Created:

2016-11-16 13:25:30 UTC

Modified:

2017-08-08 13:24:54 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Several websites are down: Invalid command 'RewriteEngine'

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

  1. Websites which use rewrite module for Apache are inaccessible.

  2. The error like the following could be found in Apache logs /var/www/vhosts/example.com/logs/error_log :

    [Mon Jan 11 11:40:06.885489 2016] [core:alert] [pid 25618] [client 10.20.30.40:40913] /var/www/vhosts/example.com/httpdocs/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
  3. Module rewrite_module for Apache is not enabled on the server:

    # apache2ctl -M | grep -i rew
    #

Cause

Rewrite module for Apache is disabled.

Resolution

Enable rewrite_module module:

Through Plesk web interface (recommended)

  1. Go to Tools & Settings > Apache Web Server > Apache modules .
  2. Check rewrite .
  3. Click on Ok .

Through command line

  1. Enable rewrite module

    # ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
  2. Reload Apache2 configuration:

    # service apache2 reload
Have more questions? Submit a request
Please sign in to leave a comment.