Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Take a look at the AllowOverride directive, which controls what sort of entries are accepted in .htaccess. This is configured in a Directory context.

http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.