- // If the requesting file is the anchor of the match, prepend it to the path info.
- if ( ! empty($req_uri) && strpos($match, $req_uri) === 0 && $req_uri != $request )
- $request_match = $req_uri . '/' . $request;
+ // If the requested file is the anchor of the match, prepend it to the path info.
+ if ( ! empty($requested_file) && strpos($match, $requested_file) === 0 && $requested_file != $requested_path )
+ $request_match = $requested_file . '/' . $requested_path;