Forcing/rewriting method from POST to GET in Apache internallyHow to make RewriteCond+RewriteRule change domain2/folder1 to domain1/folder1Add a trailing slash mod_rewriteRewriting the whole URL using mod_rewriteApache URL rewriting in reverse proxyForwarding original URI within mod_rewriteMod_rewrite: Redirect to url in query string.htaccess in Apache2 for php urlsDynamically Proxy 3rd party content to httpsApache RewriteRule doesn't works to suppress extensions, for other things, worksRewriting URLs while using mod_proxy_fcgi and PATH_INFO ends up with error 404

Are there any important biographies of nobodies?

CSV how to trim values to 2 places in multiple columns using UNIX

A word that means "blending into a community too much"

貧しい【まずしい】 poor 貧乏【びんぼう】な poor What's the difference?

What is the maximum number of net attacks that one can make in a round?

Active low-pass filters --- good to what frequencies?

Traversing Oceania: A Cryptic Journey

Arriving at the same result with the opposite hypotheses

Why 1,2 printed by a command in $() is not interpolated?

Is it legal for a bar bouncer to confiscate a fake ID

bmatrix: how to align elements' subscripts?

How does the Around command at zero work?

Wooden cooking layout

Cascading Switches. Will it affect performance?

Why does the Antonov 225 needs 6 crew members?

Is White controlling this game?

Overlapping String-Blocks

Non-aqueous eyes?

Extreme flexible working hours: how to get to know people and activities?

Who enforces MPAA rating adherence?

How can I end combat quickly when the outcome is inevitable?

Print lines between start & end pattern, but if end pattern does not exist, don't print

I have a problematic assistant manager, but I can't fire him

How to trick the reader into thinking they're following a redshirt instead of the protagonist?



Forcing/rewriting method from POST to GET in Apache internally


How to make RewriteCond+RewriteRule change domain2/folder1 to domain1/folder1Add a trailing slash mod_rewriteRewriting the whole URL using mod_rewriteApache URL rewriting in reverse proxyForwarding original URI within mod_rewriteMod_rewrite: Redirect to url in query string.htaccess in Apache2 for php urlsDynamically Proxy 3rd party content to httpsApache RewriteRule doesn't works to suppress extensions, for other things, worksRewriting URLs while using mod_proxy_fcgi and PATH_INFO ends up with error 404






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I get a POST request like /grabcontent?url=/foo/bar.html on my Apache server.



(yes, I know a POST request with a URL parameter makes no sense, but this is what I am getting from a 3rd party, cannot change this at the moment.)



/foo/bar.html is actually a valid page on my server.



How can I change this into a GET request to /foo/bar.html?



I know how to extract the URL parameter value, I know how to change the request internally using mod_rewrite.
But how can I change the request from POST to GET internally?



I could write a dummy script that simply fetches content and map it to /grabcontent of course, but I would rather avoid the extra overhead and use Apache out-of-the-box functionality.










share|improve this question



















  • 1





    You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

    – HBruijn
    May 23 at 13:50






  • 1





    Not in my case as it goes to a Java application server.

    – Deeepdigger
    May 23 at 14:37











  • If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

    – MrWhite
    May 24 at 21:42

















1















I get a POST request like /grabcontent?url=/foo/bar.html on my Apache server.



(yes, I know a POST request with a URL parameter makes no sense, but this is what I am getting from a 3rd party, cannot change this at the moment.)



/foo/bar.html is actually a valid page on my server.



How can I change this into a GET request to /foo/bar.html?



I know how to extract the URL parameter value, I know how to change the request internally using mod_rewrite.
But how can I change the request from POST to GET internally?



I could write a dummy script that simply fetches content and map it to /grabcontent of course, but I would rather avoid the extra overhead and use Apache out-of-the-box functionality.










share|improve this question



















  • 1





    You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

    – HBruijn
    May 23 at 13:50






  • 1





    Not in my case as it goes to a Java application server.

    – Deeepdigger
    May 23 at 14:37











  • If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

    – MrWhite
    May 24 at 21:42













1












1








1








I get a POST request like /grabcontent?url=/foo/bar.html on my Apache server.



(yes, I know a POST request with a URL parameter makes no sense, but this is what I am getting from a 3rd party, cannot change this at the moment.)



/foo/bar.html is actually a valid page on my server.



How can I change this into a GET request to /foo/bar.html?



I know how to extract the URL parameter value, I know how to change the request internally using mod_rewrite.
But how can I change the request from POST to GET internally?



I could write a dummy script that simply fetches content and map it to /grabcontent of course, but I would rather avoid the extra overhead and use Apache out-of-the-box functionality.










share|improve this question
















I get a POST request like /grabcontent?url=/foo/bar.html on my Apache server.



(yes, I know a POST request with a URL parameter makes no sense, but this is what I am getting from a 3rd party, cannot change this at the moment.)



/foo/bar.html is actually a valid page on my server.



How can I change this into a GET request to /foo/bar.html?



I know how to extract the URL parameter value, I know how to change the request internally using mod_rewrite.
But how can I change the request from POST to GET internally?



I could write a dummy script that simply fetches content and map it to /grabcontent of course, but I would rather avoid the extra overhead and use Apache out-of-the-box functionality.







apache-2.4 mod-rewrite






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 at 16:51









MrWhite

6,54121426




6,54121426










asked May 23 at 13:12









DeeepdiggerDeeepdigger

164




164







  • 1





    You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

    – HBruijn
    May 23 at 13:50






  • 1





    Not in my case as it goes to a Java application server.

    – Deeepdigger
    May 23 at 14:37











  • If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

    – MrWhite
    May 24 at 21:42












  • 1





    You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

    – HBruijn
    May 23 at 13:50






  • 1





    Not in my case as it goes to a Java application server.

    – Deeepdigger
    May 23 at 14:37











  • If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

    – MrWhite
    May 24 at 21:42







1




1





You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

– HBruijn
May 23 at 13:50





You don't need to convert the method from POST to GET as sending either to a static resource will simply result in that resource getting returned to the client. The static resource simply won't do any form of processing on the POST data and discard it...

– HBruijn
May 23 at 13:50




1




1





Not in my case as it goes to a Java application server.

– Deeepdigger
May 23 at 14:37





Not in my case as it goes to a Java application server.

– Deeepdigger
May 23 at 14:37













If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

– MrWhite
May 24 at 21:42





If you are going to be able to do this at all I would have thought you would need to do this at the point you send the request to the "Java application server"? How is this currently being achieved? Through a proxy? AFAIK you can't do this with mod_rewrite alone. Ordinarily you would do something like a 303 (or 302) external redirect and let the user-agent/browser reissue a GET request. But obviously this is "external", not "internal" to your server. And if the "3rd party" doesn't follow redirects (or does it?) it will just fail.

– MrWhite
May 24 at 21:42










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968571%2fforcing-rewriting-method-from-post-to-get-in-apache-internally%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968571%2fforcing-rewriting-method-from-post-to-get-in-apache-internally%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos