I want to create a rewrite rule so that
www.example.com/whatever/here
Would map to
www.example.com/index.php/whatever/here
So that $_SERVER['PATH_INFO'] is available. For that, I have created the following ruleset:
RewriteEngine On
RewriteCond {%REQUEST_FILENAME} !-f
RewriteCond {%REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
Only this gives me a 500 server error. The Apache error log states that
[Sun Sep 30 17:23:08.758705 2012] [core:error] [pid 2584:tid 1704]
[client ::1:58591] AH00124: Request exceeded the limit of 10 internal
redirects due to probable configuration error. Use
‘LimitInternalRecursion’ to increase the limit if necessary. Use
‘LogLevel debug’ to get a backtrace.
But I fail to see the recursion. When I try it with, let’s say a query:
RewriteRule ^(.*)$ index.php?route=$1
It works as expected, but $_SERVER['PATH_INFO'] is not available.
Also, before anyone asks, I want $_SERVER['PATH_INFO'] because that way, I can have complicated paths like so:
www.example.com/controller/action/data?more=data
if I require it.
Your server environment variables are specified incorrectly in the
RewriteCond, if that is your real code. If not a flat out 500 parse error, this would cause the conditions to be ignored and the rewrite to take place on every request causing a loop.