Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
3  
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

1 Answer 1

This might have something to do with your DirectoryIndex setting:

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

share|improve this answer

Your Answer

 
discard

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.