RewriteCond not working on Apache (but enabled)
8,957
Run
a2enmod rewrite
/etc/init.d/apache2 restart
And it will load the rewrite module for you
the error you are seeing is not because you dont have permissions to use rewrite but because its not available as can be seen from the a2dismod list output you provided (its not appearing in the list)
Related videos on Youtube
Comments
-
metaforce over 1 year
I get these errors in my apache error log file:
[Fri May 20 16:17:06 2011] [notice] Apache/2.2.17 (Ubuntu) PHP/5.3.5-1ubuntu7.2 with Suhosin-Patch configured -- resuming normal operations [Fri May 20 16:17:11 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration [Fri May 20 16:17:12 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration [Fri May 20 16:17:12 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration [Fri May 20 16:17:12 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration
But I have enabled mod_rewrite, and aswell as other apache mod's (as a2dismod says):
Your choices are: auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi deflate dir env headers mime negotiation php5 reqtimeout setenvif status vhost_alias
Is there a conflict with RewriteCond with some of the other mod's, or I'm missing something?
Thanks.
-
metaforce almost 13 yearsNo! :( I cannot... should I add this AllowOverride to the Directory directive in my .htaccess?
-
Derek Downey almost 13 yearsAccording to httpd.apache.org/docs/2.2/mod/core.html#directory the directory directive must be in the vhost (or main server config).
-
metaforce almost 13 yearsactually, I'm using the VirtualDocumentRoot to point the specific host to a specific directory... does that make any difference from Directory directive?