Why isn't the query string added to the GET array when using clean urls? Eg. Using /foo/bar?stack=overflow and the $_GET['stack'] variable is empty.
I'm implementing clean urls with this code:
$request = rawurldecode($_SERVER['REQUEST_URI']); // Extracts the index.php file path (eg. /my_app) // There is no need to specify the path to index.php as the script handles it $path_to_index = str_ireplace($_SERVER['DOCUMENT_ROOT'].'/', '', $_SERVER['SCRIPT_FILENAME']); $path_to_index = str_ireplace('/'.basename($_SERVER['SCRIPT_FILENAME']), '', $path_to_index); // Get rid of the path to index.php $request = str_ireplace($path_to_index, '', $request); // Get rid of index.php in the URL $request = str_ireplace(basename($_SERVER['SCRIPT_FILENAME']), '', $request); // Our URL is now clean so we can explode $request = explode('/', $request); // Delete empty and reindex $request = array_values(array_filter($request));