2

I have an index.php file which handles all requests to the server. I've set up a 404 error redirect in .htaccess in this way:

ErrorDocument 404 /index.php

If a users request a file, say, page.php, then it gets redirected to the index.php page properly.

The problem arises when the users request page.php?page=about, then my index.php is unable to retrieve the queryaboutusing$_REQUEST['page']`.

How can i get the query about through the index.php using $_REQUEST['page'] ?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Nok Imchen
  • 2,802
  • 7
  • 33
  • 59

1 Answers1

6

$_SERVER['REDIRECT_QUERY_STRING'] may contain your query strings.

Give this a shot.

<?php
    print_r($_SERVER['REDIRECT_QUERY_STRING']);
?>
Nadh
  • 6,987
  • 2
  • 21
  • 21