させたい
http://localhost/demo/index.php?r=greeting
経由でアクセスする
http://localhost/demo/greeting
config/main.php で、私は
'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>',
),
),
そして、私は以下を.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>
私は得ることができます
http://localhost/demo/index.php/greeting
働いているが働いていない
http://localhost/demo/greeting
動作する理由は何ですか?