Search code examples
apache.htaccesshttp-status-code-403

Set directory index to .html file in Apache2


I have a Debian web-server with Apache2 installed and need to set in one directory DirectoryIndex to .html file (exactly this name - .html). But when I try to open page from browser it send 403 error. I've changed apache2.conf (set to allow .ht files), I placed .htacess file in directory and set in it:

DirectoryIndex .html index.php index.html
AllowOverride All
Order Deny,Allow
Allow from all

But it still not work and displays 403 error. What i doing wrong and what i forget to do?


Solution

  • The correct answer is:

    <FilesMatch "^\.html">
            Order deny,allow
    </FilesMatch>
    
    DirectoryIndex .html