httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krist van Besien <krist.vanbes...@gmail.com>
Subject Re: [users@httpd] Rewrite all except one case
Date Thu, 16 Apr 2009 08:38:58 GMT
On Thu, Apr 16, 2009 at 10:07 AM,  <Dietmar.Mueller@eurotours.at> wrote:
> Hi all,
>
> I play a long time with rewrite to get follow rule:
>
> server/foo/(.*) should proxied to server/abc/$1
>
> This works with
> RewriteRule /foo/(.*) /abc/$1  [P]
>
> then all requests to directory /foo are proxied (also
> with arguments) to /abc/
>
> but now I need one exception:
>
> /foo should be proxied / or redirected to /abc/ers
>
>
> I try this with RewriteCondition (PATH_INFO and SCRIPT_FILENAME) but
> without success.
> The condition is either always true or false in all cases.
> I don't find the right Condition or ServerVariable

Best solution would be to have a different rule in front of your other rule:
(And you don't need the P, in fact it might cause loops)
For example:

RewriteRule ^/foo$     /abc/ers   [L]
RewriteRule ^/foo/(.*) /abc/$1

The L flag cause apache to ignore subsequent rules.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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