How to redirct POST request parameters to a URL to another URL through .htaccess

Hi there

I have read many articles about .htaccess file and I know how to use it the only thing is that
I have one seneraio whom I am not able till yet to handle it using .htaccess file.

suppose I have one url

and is receiving POST request and some POST parameter suppose param1,param2

what I want is that when I hit this URL with POST request then it will redirect to And I also want all post parameter passed to should also get redirected to

something like this in htaccess file

RewriteEngine on
RewriteRule ^someURL someRedirectedURL

and all parameteres should also redirect to new page

(I have basic knowledge of htaccess how to use it in project)

May I ask why this topic has been posted in the PHP Catagorie and also what advantages are expected rather than using PHP to detect $_POST?

Normally with a HTML form action is used to redirect the page.

It will cause havoc for anyone debugging your script if .htaccess is used to redirect the page :slight_smile:

<form action="/path/form_validation.php" method="post">
1 Like

→ first answer

Ok @John_Betong

that doesn’t come in mind :slight_smile:

because I was looking on complex regular expression written in other thread about .htaccess file.

Now simple forwarding request to a URL and then configuring that URL to redirect to another URL using .htaccess file helped matter whethar request is GET and POST all parameters are there in redirected URL

1 Like

OK I have asked the Mod’s to move this to the Server Config Category.

Let me know if you have any objections.

no i don’t have any objections

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.