httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Fellows <>
Subject Re: [users@httpd] mod_rewrite/mod_proxy
Date Thu, 20 Mar 2003 19:01:07 GMT
On Thu, 2003-03-20 at 13:16, Molly E McClure wrote:

>     RewriteEngine on
>     RewriteCond %{HTTP_HOST} ^test\.com [NC]
>     RewriteRule ^(.*) [L,R]

  This will return the redirect to the browser.  Looks like it would
  generate an endless loop :).
  Something like:
	RewriteCond %{HTTP_HOST} ^test\.com
	RewriteCond %{REQUEST_URI} !/appname/.$
	RewriteRule ^.*$ /appname/
  should do an internal rewrite to hit the Proxy rules.

>     ProxyPass           /appname/ http://appserver1:8400/appname/index.jsp
>     ProxyPassReverse    /appname/ http://appserver1:8400/appname/index.jsp
>        (Question - does this cause request to be routed back browser and
> come
>         in thru that port or does it just route it directly since app is on
>         same machine?)
> It successfully does the rewrite and then the proxy pass.
> The customer app has a properties file with entries which include the base
> address of
> the appserver1; i.e. http\://appserver1\:8400/appname

  Can you change this to drop the http\://appserver1\:8400 portion?

> The application uses this address to redirect calls to pages so that once
> it receives a request it goes back to the browser and comes in thru the
> appserver1 name directly to the oc4j container  - thereby exposing that
> name in the url vice coming back thru webcache and using the
> url.

  Really?  Unless I am missing something, ProxyPass/ProxyPassReverse
  should rewrite the hostname back to  The only
  problem might be with hardcoded references, as opposed to relative
  references, internal to returned pages.

> I can not change the name in the properties file to point to webcache
> server (alias of
> because then it cannot find any of the pages that are
> relative to that
> base address in the properties file.
> I am trying to figure out a way to reconfigure Apache/web cache/or
> properties file so
> that the only url exposed is
> I was hoping there is some Apache directive that might help.
  One other thing:  you reference both by http and https.
  If your users access the site via http and get redirected to the
  https site, the ProxyPass/ProxyPassReverse will use the in its rewrite, if I understand what you have 
  stated properly.  If that is the case, wouldn't it be better
  never to advertise the url?

Lee Fellows <>

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message