Yii Framework如何隐藏index.php?

My .htaccess content is as bellow:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

and url manager is as :

'urlManager' => array(
        'urlFormat' => 'path',
        'showScriptName' => false,
        'urlSuffix' => '.jsp',
        'caseSensitive' => false,

but when I access all sub pages and links except home page, without index.php it is not working. How to solve this ?

Set main.php in your yii configuration, at component :

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
 'caseSensitive'=>false,        

),

if this is not work you can add below script into urlManager array in main config file.

eg. -

'routeVar'=>'route'

Please modified your htaccess file with below code

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php
#RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

And change protected/config/main.php [url manager block] with below code

'urlManager' => array(
    'urlFormat' => 'path',
        'showScriptName'=>false,
        'rules' => array(
            '<controller:\w+>/<id:\d+>' => '<controller>/view',
            '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
            '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
        ),
    ),