Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php redirect with HTTP query string variables

atm I'm using the following four lines to redirect the user to another page on my website:

<?php     header("Status: 301 Moved Permanently");     header("Location: ./content/index.html");     exit; ?> 

but there is a problem with the use of HTTP query string variables like http://< url >?param=blah
they don't get appended to url understandably.

Is there a smart move for implementing this?

greetings

like image 484
Simon Lenz Avatar asked Jan 15 '11 21:01

Simon Lenz


1 Answers

<?php     header("Status: 301 Moved Permanently");     header("Location:./content/index.html?". $_SERVER['QUERY_STRING']);     exit; ?> 
like image 90
regality Avatar answered Sep 27 '22 19:09

regality