私のテスト アプリケーションではindex.php
、URL から削除しようとしています。http://localhost/trackstar/
の代わりにそのようにルートページにアクセスできますが、別のページや他のhttp://localhost/trackstar/index.php
ページにアクセスしようとするとすぐに、そのページに行き着きます。ただし、オープニングは機能します。http://localhost/trackstar/project
index.php
http://localhost/trackstar/index.php/project
WAMP サーバーを使用しています。以下のような構成。
Apache の Rewrite モジュールが有効になっています。構成main
:
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
'commentfeed' => array('comment/feed', 'urlSuffix' => '.xml', 'caseSensitive' => false),
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
'showScriptName' => false,
),
.htaccess
プロジェクトのルート フォルダー内:
Options +FollowSymlinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
も追加しましたがhttpd.conf
、実際には必要ではないと思います:
<Directory "c:/wamp/www/TrackStar/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
で追加パラメータの組み合わせをいくつか試しました.htaccess
が、自分のindex.php
ページにリダイレクトされ続けます。
これが機能しない理由について何か考えはありますか?
編集:
リダイレクトされているため、チェックインRewriteCond
が成功しません。つまりREQUEST_FILENAME
、ディレクトリまたはファイルとして見つかりません。私のディレクトリ構造に何か問題があるのでしょうか?
TrackStar\protected\views\project
たとえば、ディレクトリは、経由でアクセスしようとしているページですhttp://localhost/trackstar/project
。私のYii
フレームワーク ファイルは、www
フォルダーの上のディレクトリにあります。