php.htaccesswamp

Internal Server Error using WAMP server


I've created a MVC application using php, but when I try to access the urls it gives me "The server encountered an internal error"

When I check the log it gives me :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

my .htaccess file Code:

Options-MultiViews
RewriteEngine On

RewriteBase/MVC/public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f


RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

Solution

  • To enable mod_rewrite, went through the below steps:

    1. Find and open the file .http.conf. This will be located in your Apache install folder.
    2. Make a backup of http.conf which you can restore from, if anything were to go wrong
    3. Find the line #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash ‘#’
    4. Locate the block within the directory tags as indicated below and change to:
    <directory />
    Options All
    AllowOverride All
    </directory>
    5. Find any additional occurrences of the line “AllowOverride None” and change it to “AllowOverride All”.
    6.Finally, restart apache server and your browser. The .htaccess rewriting should now be working for any local website.