I've set up a Ubuntu server with Apache 2. Instead of FTP, I'm using WebDAV to upload/download files and it works great. However, it's not possible to upload/download or modify .htaccess files, because the Apache server returns an 404 (forbidden) error.

How is it possible to enable working with .htaccess files like with any other file?

By the way: don't worry. The WebDAV access run over a WebDAV-only host to avoid security issues.

4 Answers 4


You can't access .htaccess or .htpasswd from a normal apache because it protects them. They have sensitive information inside (usernames, special commands, etc) and it correctly does not allow you to see them.

(s)ftp is the way to do it...

If you still want to edit them...try changing this config part inside your /etc/apache2/apache2.conf:

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all


Deny from all


Allow from 
Deny from all

to allow your internal network clients to access these files...

  • Cool. It works. Thank you.
    – Bernd
    Aug 28, 2009 at 13:03

what about disabling .htaccess files with

  <Directory DocumentRoot>
      # disable the .htaccess redirect in /var/www/.htaccess
      # AllowOv. only valid in <Dir > tag!
      AllowOverride None
      Order allow,deny
      allow from all                        

For completeness, one possible resolution would be switching to svnserve, Subversion's native server, if it's practical to do such a thing.


We had the same annoying issue with apache 2.4 and it remained a showstopper for our approach to replace FTP with WebDAV until we decided to use a dedicated webdav server.

Our choice was wsgidav which does a pretty good job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy