How to do work .htaccess files in Apache2

Hello to everybody. I have a problem when I set a .htaccess file in my workspace (/srv/www/htdocs/blog/.htaccess). I thin the problem is that Apache2 not read .htaccess, because when I type this simply instruccion:


RewriteEngineOn

RewriteRule ^index.php$ index.html [L]

Apache2 don’t redirect from index.php to index.html.

I was tryed enable mod_rewrite with this command


sudo a2enmod rewrite

and the result is: “rewrite” already present

Also I was check it with phpinfo() function of PHP, and mod_rewrite it’s was loaded.

So I don’t know what is the problem with .htaccess and Apache2.

(Sorry for my bad English, my native language is Spanish from Spain)

Thanks! :smiley:

Did you configure in your Apache configuration that OOverride by .htaccess should be honoured?

        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
AllowOverride None

This way is correct?

http://oi59.tinypic.com/2wco1g9.jpg