apache - Virtually chroot clients using mod_rewrite? -


I am trying to set up WebDV website to upload / download various clients. However, I do not want each customer to see other client's data. Each client uses the SSL client certificate to authenticate, so I want them to get angry in their own directory tree.

For example:

  • The file system should map the location
  • / Somewebroot / webdav / SSL_USERNAME / upload

    I thought I could use mod_rewrite for it but any ideas for sending me an infinite redirection loop in my rule?

      surname / webdav / somewebroot / webdav & lt; Directory / somewebroot / webdav & gt; RewriteEngineRewriteBase / rewriteCond% {SSL: SSL_CLIENT_S_DN_CN} Administrator # admin on webdav has not messed up RewriteRule * - [L] Rewrite %% {REQUEST_URI}! ^% {SSL: SSL_CLIENT_S_DN_CN} / (. *) Rewrite rule ^ (. *)% {SSL: SSL_CLIENT_S_DN_CN} / $ 1 [L] & lt; / Directory & gt;  

    Once you understand that the "revertcode" supports server variables in PATTERN You have to get it in the pattern using backfirst. Apart from this, "revotic" does not use "revertibase" instructions, so you have to take it into account as well.

      alias / webdav / somewebroot / webdav & lt; Directory / somewebroot / webdav & gt; RewriteBase / webdavRewriteCond at RewriteEngine% {SSL: SSL_CLIENT_S_DN_CN} Admin # Administrator has not been interrupted RewriteRule * - [L] RewriteCond% {SSL: SSL_CLIENT_S_DN_CN} ::% {REQUEST_URI}! ^ (. *) :: / webdav/\1/(.*) rewrite rule ^ (. *)% {SSL: SSL_CLIENT_S_DN_CN} / $ 1 [L] & lt; / Directory & gt;    

Comments