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:

mysite.com/test

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

However, when I visit:

mysite.com/index

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

link|improve this question

79% accept rate
3  
Can't replicate the results you note – random Mar 4 '11 at 3:00
@random: Really? Then that is weird. – George Edison 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. – George Edison Mar 4 '11 at 3:07
Oh, and the whole thing is running on Ubuntu 10.10 64-bit. – George Edison Mar 4 '11 at 3:07
show 3 more comments
feedback

1 Answer

This might have something to do with your DirectoryIndex setting:

http://www.phpfreaks.com/forums/mod_rewrite/mod_rewrite-and-directoryindex/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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