I have moved the home directory of a site to a subdirectory, so that the sub is now the root.
I still have links in the world pointing to the subdirectory though, so I'd like to do a redirect while grabbing any and all query string parameters.
The news blog used to be at "/news/", but now the blog is the home directory.
For example, I want to redirect
example.com/news/?p=1092
to
example.com/?p=1092
The problem is that there are many query strings, and I want to grab them all.
I can't do: ($_GET["p"])
because there might also be:
example.com/news/?page=1092&location=xyz
I don't think I can use htaccess either because I am still using the news directory in the new application. So the rewrite rules would be very complicated.
I was thinking maybe I could create an index.php in the news directory and do a parse_url or $_SERVER['REQUEST_URI']; and do a split on example.com/news/ but I don't know how.
Thoughts?