a2enmod rewrite enabled makes gives me an error

Posted November 25, 2016 5k views

Just gives me this error when I enable rewrite. IP


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

This is in the error logs : `Fri Nov 25 14:31:04 2016] [alert] [client] /var/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

  • Did you restarted Apache after enabling?
    When you tried to enabled rewrite, did you used sudo if you use non-root user?

    • sudo a2enmod rewrite

    This is correct output of command:

    Correct output - a2enmod rewrite
    Enabling module rewrite. To activate the new configuration, you need to run: service apache2 restart

    As it said, it requires Apache to be restarted:

    • sudo service apache2 restart

    If you have some other output for a2enmod please post it here.

    This message usually shows if you don’t have rewrite enabled.