.htaccess and CHttpRequest.getPathInfo()

I use .htaccess to redirect from url like www.site.com/value1-value2.html to yii index.php

but some code in

is a problem and I need to comment it:


// else if(strpos($_SERVER['PHP_SELF'],$scriptUrl)===0) 

// $pathInfo=substr($_SERVER['PHP_SELF'],strlen($scriptUrl)); 

// else 

// throw new CException(Yii::t('yii','CHttpRequest is unable to determine the path info of the request.'));



Origional CHttpRequest.getPathInfo() is wrong for my .htaccess use:


<IfModule mod_rewrite.c>

  RewriteEngine On

	RewriteCond %{REQUEST_FILENAME} !-f

	RewriteCond %{REQUEST_FILENAME} !-d

	RewriteRule . php_library/yiisite/index.php

</IfModule>

this line


else if(strpos($_SERVER['PHP_SELF'],$scriptUrl)===0) 

$pathInfo=substr($_SERVER['PHP_SELF'],strlen($scriptUrl)); 

put wrong value in my $pathInfo:

my url

have to set $pathInfo to value1-value2

if I do not comment the libe above $pathInfo become empty!

Is that right or there is a better way to solve the problem?

I know I can use a custom UrlManager but I’m afraid that will be some problem in framework with the original CHttpRequest.getPathInfo() ?

The only solution I have fonund is to put this in index.php


Yii::$classMap=array(

'CHttpRequest' => 'protected/override/CHttpRequest.php'

);

Yii::createWebApplication($config)->run();



The class protected/override/CHttpRequest.php is a copy of the original

with the code changed by me.

working but on every update must copy the class in override folder end repatch the code …

someone have a better solution? :)