如何根據用戶登錄重定向 Lighttpd webdav 掛載 (How can I redirect a Lighttpd webdav mount depending on user login)


問題描述

如何根據用戶登錄重定向 Lighttpd webdav 掛載 (How can I redirect a Lighttpd webdav mount depending on user login)

I have enabled the lighttpd mod_webdav module and set up a webdav mount point of http://website.com/webdav using the following lighttpd.conf entry:

$["remoteip"] == "www.website.com" {
    alias.url += (
       "/webdav" => "/var/www/htdocs/webdav",
    )
    $HTTP["url"] =~ "^webdav($|/)" {
        dir‑listing.activate = "enable"
        webdav.activate = "enable"
        webdav.is‑readonly = "disable"
        auth.backend = "htpasswd"
        auth.backend.htpasswd.userfile = "/var/www/htdocs/passwd.dav"
        auth.require = ("" => "method" => "basic",
             "realm" => "webdav",
             "require" => "valid‑user" ) )
    }
}

This gives the same directory for all webdav users.

However, I would like to make http://website.com/webdav redirect to a particular subdirectory based on the webdav user name.

For example: 

  1. user logs in as user1, he/she sees htdocs/webdav/user1 when going to http://website.com/webdav or 

  2. user logs in as user2, he/she sees htdocs/webdav/user2 when going to http://website.com/webdav

Can this be done?

Thanks

‑‑‑‑‑

參考解法

方法 1:

Even though HTTP and WebDAV allows it, popular clients don't actually follow redirects. The result is that clients such as the windows client, os/x client can't connect to the url directly..

(by DEzraEvert)

參考文件

  1. How can I redirect a Lighttpd webdav mount depending on user login (CC BY‑SA 3.0/4.0)

#lighttpd #webdav






相關問題

Lighttpd 單個子域重定向/重寫 (Lighttpd single subdomain Redirect/rewrite)

在 lighttpd 中包含許多重寫指令 (Including many rewrite directives in lighttpd)

lighttpd:禁用 CGI 緩衝 (lighttpd: disable CGI buffering)

lighttpd:身份驗證後如何將端口(僅對本地主機可見)轉發到 WAN? (lighttpd: How to forward port (visible only to localhost) to WAN after authentication?)

在centos 404錯誤中安裝Lighttpd (install of Lighttpd in centos 404 error)

在 Lighttpd 中配置子域 (Configure subdomains in Lighttpd)

如何根據用戶登錄重定向 Lighttpd webdav 掛載 (How can I redirect a Lighttpd webdav mount depending on user login)

如何在 Windows 2003 上使用 mongrel、lighttpd 和 iis 設置負載平衡的 Rails Web 服務器 (how do i set up a load balanced Rails web server using mongrel, lighttpd and iis on windows 2003)

Lighttpd:視頻無法正常流式傳輸 (Lighttpd: Videos not streaming properly)

Apache、lighttpd、nginx、切諾基,什麼是最好的組合? (Apache, lighttpd, nginx, cherokee, what's the best combination?)

web.py + lighttpd + matplotlib 不工作 (web.py + lighttpd + matplotlib not working)

在 lighttpd 中重寫後得到錯誤的 PATH_INFO (Get wrong PATH_INFO after rewriting in lighttpd)







留言討論