I have Ubuntu 12.10 with apache2 installed, and my .htaccess file is not working. I have it set up to be able to not have .php file extensions in the links, so it looks like www.website.com/login instead of /login.php, but it says that the URL "/login" is not found on the server. I have read this page and it says something about "AllowOverride All" but I don't know where that is, or if I need to add it, where I would add it.
EDIT: I have found this link and have found what it says, but it says that I have an Internal Server Error on any page I go to. I have changed the to
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
but it says Internal Server Error
EDIT #2: In the error log, it says
/var/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
EDIT #3: Found the answer here: .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Also make sure you these lines at the top of your .htaccess:
i.e. turn the
MultiViews
options off.Also see this Q&A for a similar problem and my answer.
You should have or specify Directory-block in your apache configurations. You can find
AllowOverride
documentation here: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverrideAnd documentation about
<Directory>
is here: http://httpd.apache.org/docs/2.2/mod/core.html#directoryIn short: specify where you would like to allow the settings to be overridden with
<Directory /path/to/your/directory>
and then useAllowOverride all
in that directory block.