You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andrew Pimlott <an...@pimlott.net> on 2004/01/27 15:16:01 UTC
[users@httpd] serving two filesystem trees "overlaid"
Is it possible (in Apache 1) to have a URL path map to two (or more)
filesystem paths, using the first file found? So the effect is like
one filesystem tree overlaid on another.
The reason I ask for this is I want to serve plain files and scripts
in the same URL namespace, but keep them in different directories to
reduce the risk of a script being served as a plain file, and
vice-versa. For example, I might have /www/files/a.html and
/www/scripts/b.html, where http://example.com/a.html sends the file,
and http://example.com/b.html runs the script. I would use
<directory> directives to ensure that everything in /www/files is
sent as a file, and everything in /www/scripts is run as a script.
As you can see from the example, I don't want to use different
naming conventions for files and scripts, so I can't use a simple
pattern to determine the correct path. It is necessary to check
which tree actually contains the file.
I can probably hack up some solution in mod_rewrite or mod_perl, but
I wondered if there is a more idiomatic way to do this. If not, can
you think of any other way to achieve my goal?
Andrew
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] serving two filesystem trees "overlaid"
Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 27 Jan 2004, Andrew Pimlott wrote:
> Is it possible (in Apache 1) to have a URL path map to two (or more)
> filesystem paths, using the first file found? So the effect is like
> one filesystem tree overlaid on another.
> I can probably hack up some solution in mod_rewrite or mod_perl, but
> I wondered if there is a more idiomatic way to do this. If not, can
> you think of any other way to achieve my goal?
mod_rewrite is the standard way to do this. See "search pages in more
than one directory" under
http://httpd.apache.org/docs-2.0/misc/rewriteguide.html#url
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org