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] Experience in mod_rewrite in Apache 2.2
Date Tue, 22 May 2007 17:45:26 GMT
On 5/22/07, Dmitriy Gorbenko <bazil@agenstvo.com> wrote:

> I think I could do it using mod_rewrite, but now I understand, that I
> can't: in apache config file I can create rules, which will makes an
> decision: redirect or proxy request of client (R and P flags).
> But by using external program I can't make such decision.
> And that is a problem.

Ahhh, so your question is: how do I activate rewrite flags from a prg:
RewriteMap. (Not at all clear from your first email.)

Indeed, this can't be done directly, but it can be easily done
indirectly. For example, have your map program prefix the URL with
proxy: or redirect: depending on what you want, and then:
RewriteRule ^(.+)$ ${rd:%{THE_REQUEST}}
RewriteRule ^proxy:(.*)$ $1 [P]
RewriteRule ^redirect:(.*)$ $1 [R]

(Use the RewriteLog to debug!)

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