Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Don't use .htaccess!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Don't use .htaccess!
Authored by: Elander on Aug 01, '02 02:29:16AM

You say that you have a structure like this:

/Main-Dir/
/Main-Dir/Pictures/
/Main-Dir/Documents/
/Main-Dir/Sites/

And you want any webdav access to take the user to the root level - /Main-Dir/ and require a login/pass. All other access (e.g. http/web) should take the user to the /Main-Dir/Sites/ dir without login/pass and not allow them to traverse back up the dir structure.

Well, that just won't work. WebDAV uses http, so there is no separation by protocol. The server doesn't treat a webdav client any different from a web browser, and it is not supposed to either. You have to rethink your strategy, i.e. move "/Main-Dir/Sites" somewhere else, or create a separate virtual server.

I would probably do something like this: set up a virtual server on another port (eg 8888), and use webdav to serve up "/Main-Dir/" on that server. Use the default server to serve normal web browsers and use the /Main-Dir/Sites folder as root folder on that.

I haven't tested it, but I can't see any reason why it should'nt work.



[ Reply to This | # ]
Don't use .htaccess!
Authored by: bluehz on Aug 01, '02 02:44:24PM
So far thats the only solution I have found also.
I would probably do something like this: set up a virtual server on another port (eg 8888), and use webdav to serve up "/Main-Dir/" on that server. Use the default server to serve normal web browsers and use the /Main-Dir/Sites folder as root folder on that.


[ Reply to This | # ]