Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here are all of my rewrite rules: (there are no others - this is all of them)

RewriteEngine On
RewriteRule ^$ index.php?action=index
RewriteRule ^([\w]+)$ index.php?action=$1

When I visit:

The PHP script index.php is indeed invoked and has $_GET['action'] set to test as expected.

However, when I visit:

...the PHP script reports that $_GET is empty. Why does this happen only for index?

share|improve this question
Can't replicate the results you note – random Mar 4 '11 at 3:00
@random: Really? Then that is weird. – Nathan Osman Mar 4 '11 at 3:04
/ alone will be empty, but /index was sending through to $_GET fine – random Mar 4 '11 at 3:05
I'm using Apache 2.2.16 and PHP 5.3.3-1ubuntu9.3. – Nathan Osman Mar 4 '11 at 3:07
Oh, and the whole thing is running on Ubuntu 10.10 64-bit. – Nathan Osman Mar 4 '11 at 3:07

This might have something to do with your DirectoryIndex setting:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.