Hello, I am hoping that someone can assist me with this. I have been trying different things for days and I am not skilled enough to pull it off. I am also assuming this might be possible. What I am trying to do is have a webdav user redirected to a php file that will make their webdav folder and redirect to it if it does not exist.
I have a virtual host like below:
<VirtualHost *:80>
ServerName video.example.com
ServerAlias video.*
ServerAdmin webmaster@localhost
#
RewriteEngine On
RewriteLog /var/log/rewrite.log
RewriteLogLevel 9
#
RewriteCond /var/www/webdav/%{LA-U:REMOTE_USER} -d
RewriteRule ^/(.*) /var/www/webdav/%{LA-U:REMOTE_USER}/$1
#
RewriteCond /var/www/webdav/%{LA-U:REMOTE_USER} !-d
RewriteRule ^/(.*) /var/www/webdav/register/$1?username=%{LA-U:REMOTE_USER}
#
DocumentRoot /var/www/webdav
DirectoryIndex "index.php"
#
<Directory /var/www/webdav>
Options Indexes MultiViews +FollowSymlinks
AllowOverride None
Order allow,deny
Allow from all
DAV On
AuthType Basic
AuthName "Drop Box"
AuthBasicProvider ldap
AuthLDAPURL ldap://odm.example.com:389/dc=odm,dc=example,dc=com?uid
Require valid-user
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
index.php located at /var/www/webdav/register/
<?php
$username = $_GET['username'];
mkdir("/var/www/webdav/" . $username, 0777);
?>
I know this is not safe, but at this point I am just trying to get it working. This is not a public facing server.
If I log on using my Mac, it creates the folder for me no problem, when I log in with cadaver, it logs in and redirects me to the /var/www/webdav/register folder and doesn't create the folder.
I can live with the fact that this is possibly not doable, just need to know that from a seasoned expert.
Cheers!
Z