Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Apache 1.3 - Forward POST request

Options
  • 12-06-2006 10:31am
    #1
    Registered Users Posts: 104 ✭✭


    Hi Guys,

    I'm not sure if this is the most relevent forum but I'm guessing most of the knowledge is here.

    I'm configuring a server which has two versions of Apache running. Apache2 and 1.3. Apache2 just forwards everything on to Apache1.3 as somestimes I receive requests chunk encoded. Apache1.3 rejects chunk encoding.

    Now I have a situation where clients are sending POST requests to:
    http://testserver.blah.com/aaa

    But I want to forward the POST requests coming to the above URL to:
    http://testserver.blah.com/bbb

    The situation is made more complicated in that I must forward the POST requests only. The GET requests must not be forwarded away from /aaa for authentication reasons.

    Does anyone know how this can be done? mod_rewrite maybe?
    If anyone wants to reply with some info please bare in mind that I have very basic knowlede of HTTP and very limited experience configuring Apache.

    Cheers for the help if you have any!


Comments

  • Closed Accounts Posts: 139 ✭✭utopian


    Now I have a situation where clients are sending POST requests to:
    http://testserver.blah.com/aaa

    But I want to forward the POST requests coming to the above URL to:
    http://testserver.blah.com/bbb

    If when you say "forward" you mean within Apache (i.e. no client redirect), then you could use mod_rewrite to do this (without the R flag). However, assuming that aaa/bbb are dynamic, why not let them act based on whether the request is GET or POST?
    The situation is made more complicated in that I must forward the POST requests only. The GET requests must not be forwarded away from /aaa for authentication reasons.

    You can use RewriteCond and $REQUEST_METHOD for this.

    (edited to change incorrect reference to Limit directive)


  • Registered Users Posts: 104 ✭✭GenericName


    utopian wrote:
    If when you say "forward" you mean within Apache (i.e. no client redirect)
    -Yep, this is what I want to do.

    utopian wrote:
    Assuming that aaa/bbb are dynamic
    -No aaa/bbb are static.

    utopian wrote:
    You can use RewriteCond and $REQUEST_METHOD for this.
    -Excellent. Thanks for your help. The GET vs POST was what I was most unsure of. Cheers.


  • Registered Users Posts: 104 ✭✭GenericName


    This is what I am including in the httpd.conf of Apache1.3:

    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteRule /aaa http://127.0.0.1:8800/bbb/ [P]


    Can you tell me if this is correct?

    Cheers


  • Registered Users Posts: 104 ✭✭GenericName


    Problem solved!
    The RewriteRule needed to be placed in the Apache2 conf.
    Thanks again


Advertisement