Accessing a webpage folder with .htaccess in it via apache webdav?
Posted
by
pingo
on Server Fault
See other posts from Server Fault
or by pingo
Published on 2012-06-03T21:49:26Z
Indexed on
2012/06/03
22:41 UTC
Read the original article
Hit count: 231
I have setup webdav access in order to enable an external user to upload the content of his web page to his folder on my server that is served by apache to the web. This way he could update his web page via webdav.
Now the problem is that the user requires a .htaccess file and of course .htaccess breaks webdav probably because it overrides settings. (new files cannot be uploaded anymore via webdav if below specified .htaccess exists)
I am running Apache2.2.17 and this is my webdav config:
Alias /folderDAV "d:/wamp/www/somewebsite/"
<Location /folderDAV>
Order Allow,Deny
Allow from all
Dav On
AuthType Digest
AuthName DAV-upload
AuthUserFile "D:/wamp/passtore/user.passwd"
AuthDigestProvider file
require valid-user
</Location>
This config is part of my naive solution to fixing this problem. The idea was to specify an alias to the web page folder where webdav would be enabled and then set AllowOverride to none so that the .htaccess would have no effect. Of course I then found out that in <Location /> AllowOverride directive is not valid.
The .htaccess file looks like this:
#opencart settings
Options +FollowSymlinks
Options -Indexes
<FilesMatch "\.(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
ErrorDocument 403 /403.html
deny from 1.1.1.1/19
allow from 2.2.2.2
What would be the solution here? I would like to have the web page accessible from the web but at the same time be able to access and modify it via apache's webdav (with digest auth). How would I do that?
Also if possible I would like a solution that permits the existence of the .htaccess so that the user still has the power to setup access rules for his web page.
© Server Fault or respective owner