How to upload/download or modify .htaccess files using WebDAV

.htaccessapache-2.2webdav

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.

Best Answer

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
</Files>

Change

Deny from all

to

Allow from 192.168.1.0/24 
Deny from all

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

Related Topic