Forum Moderators: phranque
This one has me kinda flummoxed..
I have about 14 billion different pages pointing to a cart page. I need to move the cart page. I would like to put in a redirect to say:
"Take every POST and GET variable passed to this page and send it to the new page".
So:
Visitor posts to:
example.com/cart/index.php
This gets redirected to:
someotherhost/cart/index.php
with all post and get vars intact.
htaccess, perl, or php solutions would be cool, but I would love to do it with a nice tidy htaccess file.
Thanks for any help,
Bill
Here is my form code:
<form name="form1" method="post" action="https://2.2.2.2/redirect/">
<input name="name" type="text" id="name" value="ttttttttttttttt">
</form>
Here is my .htacess code (in root of 2.2.2.2/redirect):
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ [1.1.1.1...] [R]
Here is my showvar.php code:
<?=$_POST["name"]?>
Any pointers would be appreciated.
Bill
If the data isn't sensitive(ie product info) you could put a header() redirect and change the POST vars to GET vars.
foreach($_POST as $key => $val) $formfields .= "&".$key."=".urlencode($val);
header("Location: newurl.php?r=0".$formfields);
exit;
Note:
The?r=0 part of the redirect is just a dummy var so all the rest can use the & delimiter.
Sorry if this is of no help.