Suppose I want to redirect all GET
queries from one site to another, using PHP
.
POST
queries do not exist in the system.
For example, when the user connects to
www.mysite.com/index.php?action=myAction&pageno=2
I want him to be redirected to:
www.mySecondSite.com/index.php?action=myAction&pageno=2
I can get write a hard-coded code for each and every possible $_GET
variable (myAction
and pageno
in my example), but it does not sound like a reasonable solution. Also, I've seen this solution which involves modifying the configuration of the Apache server. Suppose I can't change the server configuration.
For sure, there must be a way to get all of the variables and their values, and redirect it to another site.