Hey everyone,
Maybe I am missing something but I can't seem to figure this one out.
I have a ReWriteRule:
RewriteRule ^view/(\w+)$ view.php?mmdid=$1 [L]
and when I go to mydomain.org/view/3, the $_GET array is empty. There is no key 'mmdid'.
However, when I change my rule to something else, such as:
RewriteRule ^viewz/(\w+)$ view.php?mmdid=$1 [L]
it works fine when I visit mydomain.org/viewz/3. I get Array ( [mmdid] => 1 ) when printing $_GET.
There are no other rules similar to this that could conflict, and I've rebooted apache.
Any ideas on why this happens? Is 'view' a keyword or something?
Here is the contents of the Rewrite log:
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a61030/subreq] (1) [perdir /path/to/webroot/] pass through /path/to/webroot/view.php
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a54000/initial] (3) [perdir /path/to/webroot/] add path info postfix: /path/to/webroot/view.php -> /path/to/webroot/view.php/1
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a54000/initial] (3) [perdir /path/to/webroot/] strip per-dir prefix: /path/to/webroot/view.php/1 -> view.php/1
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a54000/initial] (3) [perdir /path/to/webroot/] applying pattern '^(.*)$' to uri 'view.php/1'
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a54000/initial] (4) [perdir /path/to/webroot/] RewriteCond: input='mydomain.org' pattern='^www\.mydomain\.org$' => not-matched
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2a54000/initial] (1) [perdir /path/to/webroot/] pass through /path/to/webroot/view.php
192.168.204.187 - - [15/Jun/2009:13:01:19 --0400] [mydomain.org/sid#2787ab8][rid#2930e58/subreq] (1) [perdir /path/to/webroot/] pass through /path/to/webroot/1
Here is the output of the log when using just ^v/(\w+)$....
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (3) [perdir /path/to/webroot/] add path info postfix: /path/to/webroot/v -> /path/to/webroot/v/1
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (3) [perdir /path/to/webroot/] strip per-dir prefix: /path/to/webroot/v/1 -> v/1
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (3) [perdir /path/to/webroot/] applying pattern '^v/([0-9]+)$' to uri 'v/1'
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (2) [perdir /path/to/webroot/] rewrite 'v/1' -> 'view.php?mmdid=1'
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (3) split uri=view.php?mmdid=1 -> uri=view.php, args=mmdid=1
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (3) [perdir /path/to/webroot/] add per-dir prefix: view.php -> /path/to/webroot/view.php
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (2) [perdir /path/to/webroot/] strip document_root prefix: /path/to/webroot/view.php -> /view.php
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a63038/initial] (1) [perdir /path/to/webroot/] internal redirect with /view.php [INTERNAL REDIRECT]
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (3) [perdir /path/to/webroot/] strip per-dir prefix: /path/to/webroot/view.php -> view.php
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (3) [perdir /path/to/webroot/] applying pattern '^v/([0-9]+)$' to uri 'view.php'
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (3) [perdir /path/to/webroot/] strip per-dir prefix: /path/to/webroot/view.php -> view.php
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (3) [perdir /path/to/webroot/] applying pattern '^(.*)$' to uri 'view.php'
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (4) [perdir /path/to/webroot/] RewriteCond: input='mydomain.org' pattern='^www\.mydomain\.org$' => not-matched
192.168.204.187 - - [15/Jun/2009:13:10:09 --0400] [mydomain.org/sid#2787ab8][rid#2a5ebc0/initial/redir#1] (1) [perdir /path/to/webroot/] pass through /path/to/webroot/view.php
Thank you,