Joshua Slive wrote:
> On 5/22/07, Dmitriy Gorbenko <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> " from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Yes, but in this case the logic of making decision (doing proxy or
redirect) imposes oneself to URL. It still is possible to agree with this.

Let's admit, the user is sent URL, in which where is a word proxy.
However that logic, which I wish to create, should in some cases do not
proxy request, but do redirect. And if we have written rule
RewriteRule ^proxy:(.*)$ $1 [P]
then the program which process request cannot change action proxy to
redirect.

Look at this three examples - they perfectly illustrate that behaviour
which I wish to create:

C:  GET http://ofiice.domain.com/document.html
S:  302 - http://login.domain.com/ (redirect method)
C:  GET http://login.domain.com/?username=aaa&passwd=bbb 
<http://login.domain.com/?username=aaa&passwd=bbb>
S:  302 - http://office.domain.com/afjgn39nxnx8n3f29ss/document.html
(redirect method)
C:  GET http://office.domain.com/afjgn39nxnx8n3f29ss/document.html
S:  gives resource content (proxy to some local resource)

Clients tries to acces some document, but server want client to be
authenticated before. Server create paramert session-id
(afjgn39nxnx8n3f29ss), and client should use this session-id to access
resource office.domain.com. And later, than client send this session-id.
server will proxy such request to local network server, which is not
public, and which contains 'document.html' resource.

Or another example, where client, 1 hour later, tries to access the same
document:

C:  GET http://office.domain.com/afjgn39nxnx8n3f29ss/document.html
S:  302 - http://login.domain.com/ (redirect method)
C:  GET http://login.domain.com/?username=aaa&passwd=bbb 
<http://login.domain.com/?username=aaa&passwd=bbb>
S:  302 - http://office.domain.com/jh43hkjshdfsdyhskdvc/document.html
(redirect method)
C:  GET http://office.domain.com/jh43hkjshdfsdyhskdvc/document.html
S:  gives resource content (proxy to some local resource)
And another one (here session-id parametr is correct, and we just doing 
proxing):

C:  GET http://office.domain.com/ndfklweuixxnlfljdklj/document.html 
<http://office.domain.com/jh43hkjshdfsdyhskdvc/document.html>
S:  gives resource content (proxy to some local resource)


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to