views:

21

answers:

1

Is there a way to do this? I'd like for my assets to be served from a different document root, and I'm not sure if Apache has directives for that.

+1  A: 

To serve whole directories from a different location, there's Alias:

Alias /assets /path/to/assetsdir

works in httpd.conf only, though, if you want to point outside the web root.

For specific files there is AliasMatch.

Pekka
I'm looking for something more like how nginx allows. So that if the filetype matches a certain group, then the document root is a different one.
Matthew
@Matthew there's `FilesMatch`: http://httpd.apache.org/docs/2.2/mod/core.html#filesmatch but I don't think it will allows specifying a different document root altogether. I think `AliasMatch` with a regular expression that catches the file types you specify is going to be your best bet.
Pekka