You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Phil Armour <pb...@MIT.EDU> on 2002/01/29 06:40:50 UTC

setting apache to insert file extensions

Hi,
i am trying to understand how to configure apache to insert a list of 
extensions if just the filename is given.
for example if the url is http://localhost/test
i would like the server to first look for test.html then test.jsp then 
test.jpg,  etc.

I also have a ProxyPass and ProxyPassReverse directives enabled for the 
purpose of redirecting to my j2EE container. ie.
ProxyPass         / http://localhost:8888/
ProxyPassReverse  / http://localhost:8888/

i would like to be able to serve static files(.html and .jpg) from Apache 
(fast) and only hit the j2EE container for the JSPs in addition to the 
first goal stated above.  If you have any ideas (possibly some way with 
mod_rewrite) i would be grateful.

thanks,
-phil



---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: setting apache to insert file extensions

Posted by Daniel Lopez <da...@rawbyte.com>.
> Hi,
> i am trying to understand how to configure apache to insert a list of 
> extensions if just the filename is given.
> for example if the url is http://localhost/test
> i would like the server to first look for test.html then test.jsp then 
> test.jpg,  etc.

the Multiviews parameter to the Option directive may do what you want.
Check the multiviews section at
http://httpd.apache.org/docs/mod/mod_negotiation.html

> I also have a ProxyPass and ProxyPassReverse directives enabled for the 
> purpose of redirecting to my j2EE container. ie.
> ProxyPass         / http://localhost:8888/
> ProxyPassReverse  / http://localhost:8888/
> 
> i would like to be able to serve static files(.html and .jpg) from Apache 
> (fast) and only hit the j2EE container for the JSPs in addition to the 
> first goal stated above.  If you have any ideas (possibly some way with 
> mod_rewrite) i would be grateful.

RewriteEngine On
RewriteRule ^(.*jsp$) http://localhost:8888/$1 [P]

should work and reverse proxy request for files ending in jsp extension

Daniel

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org