httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Rewrite - Almost there !
Date Mon, 07 Aug 2006 17:39:03 GMT
On 8/7/06, SOPRO <soprobr@gmail.com> wrote:
> Hi friends,
>
>  I'm trying to write a rule, that takes the client id and pass to an
> application hosted on a jboss server.
>
> <VirtualHost *:443>
>     ServerName server.mydomain.com
>     RewriteEngine On
>     RewriteLog "/var/log/apache/rewrite-ssl.log"
>     RewriteLogLevel 3
>
>     RewriteCond %{REQUEST_URI} ^/app/.*
>     RewriteRule ^/(.*)/([^/]+)$ http://localhost:5050/app/index.jsp?id=$2 [P]
> </VirtualHost>
>
>  When I type 'server.mydomain.com/app/client1', the rule sends this to
> my jboss sever:
>
> http://localhost:5050/app/index.jsp?id=client1
>
>  The problem is that it was sending these requests too:
>
> http://localhost:5050/app/index.jsp?id=stylesheet.css
> http://localhost:5050/app/index.jsp?id=logo_client1.png
>
>  How can I make it stops in the first rewrite  (id=client1) ?

Each request is an entirely separate entity to apache httpd.  So you
need to find a way to differentiate the requests you wnat forwarded
from the requests you want served locally.

For example, you could add the following:
RewriteCond %{Request_URI} !.*\.(css|png)
or if you are sure that the clientid never contains a period, simply:
RewriteCond %{Request_URI} !\.

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


Mime
View raw message