Skip to content
Advertisement

PHP Redirect with query parameters

Let’s say I have the following URL:

JavaScript

What I want the PHP query to do is redirect the user to the following URL:

JavaScript

Of course, the URL should not only redirect ?user/1234 but also ?anything/343. I want to leave the url intact and only add the /test/ to it, and leave the part afterwards the same.

How do I accomplish that? All I could find is just general redirection and not specific to URLs. Thanks.

Advertisement

Answer

I modified Kasia Gogolek’s answer so that it works for me. This is the solution to my question:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement