I have this error when trying to browse php files locally
[Fri Apr 13 19:16:40 2012] [alert] [client 127.0.0.1] C:/AppServ/www/hr-website/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://127.0.0.1/
what is the problem ?
Check to make sure you have
mod_rewrite
enabled.From: https://webdevdoor.com/php/mod_rewrite-windows-apache-url-rewriting
If the
LoadModule rewrite_module modules/mod_rewrite.so
line is missing from the httpd.conf file entirely, just add it.Also make sure php is enabled by uncommenting the
line that comes right after
Make sure both those lines in
are uncommented.
Just Follow Simple 1-2-3 Steps :
This comment from verybadbug under question helped me:
After that we need restart Apache:
Under Apache 2+ you can simply do as below (Using Linux Terminal):
sudo a2enmod rewrite && sudo service apache2 restart
or
sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart
I can see that your using AppServ, mod_rewrite is disabled by default on that WAMP package (just googled it)
Solution:
Find:
C:/AppServ/Apache/conf/httpd.conf
file.and un-comment this line
#LoadModule rewrite_module modules/mod_rewrite.so
Restart apache... Simplez