logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Redirecting GET Requests
Author
shug94



Joined: 27 Aug 2009
Posts: 9

PostPosted: Wed 02 Sep '09 10:47    Post subject: Redirecting GET Requests Reply with quote

Hey guys,

Is it possible to redirect ALL GET requests to a particular Perl script? I want all POST requests to go to one Perl script, all GET requests to go to another, and all PUT requests to go to a third Perl script.

I know how to redirect based on url, but not based on HTTP Request method. Any help in this would be muchly appreciated.

Thanks,

Cam
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 22 Oct '09 12:44    Post subject: Reply with quote

I know only how to redirect all requests through one file

Code:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/dispatch.pl(.*)$
RewriteRule ^(.*)$ /dispatch.pl?$1


maybe you can handle the GET / POST / PUT stuff inside your script
Back to top


Reply to topic   Topic: Redirecting GET Requests View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner