Forum Moderators: phranque

Message Too Old, No Replies

Different documentroots in different directories?

         

fadecomic

11:25 pm on Jan 21, 2010 (gmt 0)

10+ Year Member



Hi,

I'm trying to do something that seems like it should be simple, but I can't figure it out.

I want to set a different documentroot for a given directory specified in the url.

In other words, I want www.example.com to go to the regular documentroot, but I want www.example.com/stuff to go to /usr/shared/pub/stuff.

I tried specifying a DocumentRoot inside a Location directive:


<Location /stuff>
DocumentRoot /usr/shared/pub/stuff
AuthType Basic
AuthName "Stuff is here"
AuthUserFile /etc/apache2/stuff-auth-file
Require valid-user
</Location>

But that overwrites the DocumentRoot for the whole site. How can I do this? I don't want to use virtual hosts because I want this available to the public.

Thanks in advance.

fadecomic

11:32 pm on Jan 21, 2010 (gmt 0)

10+ Year Member



To clarify a bit more, I want to be able to do what the SVN module does so sweetly with SVNParentPath:


<Location /svn>
DAV svn

SVNParentPath /Users/Shared/svn

AuthType Basic
...
</Location>

fadecomic

12:09 am on Jan 22, 2010 (gmt 0)

10+ Year Member



Ignore. I figured it out.

g1smd

12:26 am on Jan 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What did you use?

An internal rewrite is one way to tackle this.

fadecomic

12:50 am on Jan 22, 2010 (gmt 0)

10+ Year Member



I just used the Alias directive, actually. I was aware of it, but I never really played with it before. Real headsmacker.


<Directory "/Users/Shared/stuff">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /stuff /Users/Shared/stuff