Modifying WP URL handing code?

I ended up solving this with a little bit of code (in the form of a plugin):

if(isset($_GET['state']) OR isset($_GET['city'])) {
$url = explode("https://wordpress.stackexchange.com/", $_SERVER['REQUEST_URI']);
$url = end($url);
$_SERVER['REQUEST_URI'] = "https://wordpress.stackexchange.com/" . $url;
}

This code in essence removes the “/arizona/” or “/arizona/phoenix/” from the REQUEST_URI global variable and replaces it with “https://wordpress.stackexchange.com/”, which then forces WP to serve up the front page template using index.php. Fixed!

Perhaps a few of you can vote this answer up for me. 🙂