0

ゆいちゃんと遊んでます。.htaccess と main 設定を使用して URL に存在する Entry スクリプトを削除しましたが、CHtml::links() を使用すると再び表示されます。どうすれば修正できますか?例えば:

<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>

更新:私の urlManager 構成:

'urlManager'=>array(
        'urlFormat'=>'path',
        'rules'=>array(
        '<controller:\w+>/<id:\d+>'=>'<controller>/view',
        '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
        '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
        'commentfeed'=>array('comment/feed','urlSuffix'=>'.xml', 'caseSensitive'=>false),
        'showScriptName'=>false,
        'caseSensitive'=>false,
        '<pid:\d+>/commentfeed'=>array('comment/feed','urlSuffix'=>'.xml', 'caseSensitive'=>false),
        ),

私の.htaccess

Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
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
</IfModule>
4

1 に答える 1

2

構成ファイルで showEntryScript を false に設定する必要があります。

その方法については、フレームワークの公式の指示に従ってください: http://www.yiiframework.com/doc/guide/1.1/en/topics.url#hiding-x-23x

于 2013-02-17T21:44:13.517 に答える