cURL to return query string of re-writte URL (mod_rewrite)

I’m trying to tidy up the code of large site I developed a while back. The URLs are re-written using mod_rewrite. I am trying to build an array of associative arrays, each one containing the page title, URL, query string (I used query strings in conjunction with a controller to load pages) and some other things. I really don’t have time to build this list by hand.

So I’m trying to write a crawler that will start at index.php, get the page title, URL and query string, add them to an array, build a list of links to URLs on the same website and do the same for them, until all links are exhausted. I am trying to do this remotely from my localhost, although I could run it on my clients host account too.

So far I’ve gotten stuck because I don’t know how to get the query string that is output when mod_rewrite rewrites the URL in the header. It also sucks because once I re-wrote those URLs, I went though the whole site and hard-coded the old internal links to the new SEO friendly URLs.

I’m trying to use cURL extension of PHP5 but can’t figure it out. Could someone tell me how to output that information? Thanks


Thanks for suggestion but I want to know how to do it when launching the script from my localhost, checking my clients site remotely. That’s why I was trying to figure it out with cURL library. If I put your suggestion it will just ask my localhost for that info.

I meant to put that someone on the site in question, have it output it. You cannot get the query string any other way.
There is no “get real rewriten URL function”