Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration

i ran a2enmod rewrite, it says "mod already enabled"

Now i get

RewriteEngine not allowed here
share|improve this question

2 Answers 2

If you have your rules in a .htaccess file, then the reason for the not allowed here is almost certainly the AllowOverride setting is too restrictive. Generally it is set by default to allow very little. In your site's configuration in /etc/apache2/sites-available/foobar, add this, adjusting the directory path of course:

<Directory /var/www/mydirectory>
    AllowOverride +FileInfo
</Directory>
share|improve this answer

Restart Apache, perhaps? If you're trying to do this in a .htaccess file. Certainly, "Invalid command 'RewriteEngine'" indicates that mod_rewrite is not enabled, regardless of what a2enmod might say on the matter. Perhaps make sure that /etc/apache2/mods-enabled/rewrite.load has sensible-looking contents, in case something went a bit spare in there.

share|improve this answer
    
now i am getting RewriteEngine not allowed here –  hwohgo Oct 23 '09 at 4:26
    
What is the difference between "Now" and "Then"? If you are doing this in a htaccess, yes, you don't use RewriteEngine On, you just define your rewrite rules. –  womble Oct 23 '09 at 4:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.