I am bigginer to php and i was trying to implement Model-View-Controller in php i updated allow override to all and created a .htacess file and wrote the following quotes in it,
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 {QSA,L}
but i gave me 500 error and i went straight to apache error log and got these errors:
[Mon Apr 09 01:18:36 2012] [alert] [client ::1] C:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps
misspelled or defined by a module not included in the server configuration
I googled and googled but cant find it, i just want to pass all the request to index.php file i watched a video on youtube it was working fine in his computer but not on mine, he told i should modify something in php.ini but i don’t know whats that, if i write the following in .htacess:
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
and goto url that dont exists, then it is controlled by 404.php but it i tried to write the first script then i gives me 500 error every time… Previously i also tried to install zend framework but still there was same error….
I apologize for my language,,,
thanks in advanced… please help…
Is your rewrite module in apache enabled? You can enable it in httpd.conf file in your installation dir. If you are using windows just uncomment the rewrite module line and restart your apache.
You can google “enable apache rewrite” for more information.