How to enable .htaccess for Apache 2 in Ubuntu 11.10

.htaccessapache-2.2

I upgraded my laptop from Ubuntu 10.04 to Ubuntu 11.10. Now my apache webserver doesn't seem to recognize the .htaccess file because none of my url rewrites are working. I tried an a2enmod rewrite but apache says it's already enabled. I restarted the apache server, but my rewrites still don't work. I tried typing garbage text into my .htaccess file hoping to create errors such as 500 Internal Server errors, but no errors occurred. It's as if Apache isn't even reading my .htaccess files. My apache2.conf file has a line that says AccessFileName .htaccess.

How do I get my RewriteRules in .htaccess file working again?

Best Answer

Well, if the .htaccess files are truly not getting parsed, you need an AllowOverride directive in your main config:

AllowOverride FileInfo

(that'll allow your mod_rewrite directives, use All if you need to allow any directive)

By the way, why use .htaccess at all? From the docs:

In general, you should never use .htaccess files unless you don't have access to the main server configuration file.