I just finished work on my beautiful PHP script, which needs the ability to use GET variables. However, when I handed over the script to the guy it's made for, I figured out that they have a bunch of rewrite rules enabled for AJAX loading.
His old webmaster wrote these rules, but failed to comment them, and we cannot seem to get in contact with him, so now it seems to be my problem.

Heres the specific case:
My script is located at /_ajax/program2.php
This is the rewrite rule:
RewriteRule ^ajax/([^/]*)/([^/]*)/?([^/]*)/?$ /_ajax.php?popup=yes&mode=$1&id=$2&ting=$3&%{QUERY_STRING} [L]
And finally _ajax.php which handles the corresponding requests:
PHP Code:
include_once($_SERVER['DOCUMENT_ROOT'] . "/includes/func.php");

#require_once($_SERVER['DOCUMENT_ROOT'] . "/includes/cache_start.php");

if(isset($_SESSION['admtime']) && $_SESSION['admtime'] < time()) {

$_GET["mode"] == "404"){
$_GET["mode"] = str_replace("/"""$_SERVER['REQUEST_URI']);

$_GET["mode"])) $site $_GET["mode"];
$_GET['id']) && file_exists($_SERVER['DOCUMENT_ROOT']  ."/_ajax/"mb_strtolower($_GET['mode'] ."-"$_GET['id']) .".php")) $site $_GET['mode'] ."-"$_GET['id'];

//echo $site."<br/>";
if(empty($site) || file_exists($_SERVER['DOCUMENT_ROOT']  ."/_ajax/"mb_strtolower($site) .".php") === false) {
$site "frontpage";
$_SERVER['DOCUMENT_ROOT'] ."/_ajax/" mb_strtolower($site) . ".php"); 
How would I want to modify this file (or the htaccess) in order to be able to use the GET variables such as /program2/?mystuff=foobar? I assume the rewrite rules somehow allows for passing some information through the URL.