Question

a2enmod rewrite enabled makes gives me an error

Posted November 25, 2016 2.8k views
MySQL Apache PHP Debian

Just gives me this error when I enable rewrite.
138.197.4.205 IP

2 comments

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.

1 answer

This is in the error logs : `Fri Nov 25 14:31:04 2016] [alert] [client 24.177.243.68] /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.

Submit an Answer