隐藏index.php不行

设置了.urlFormat为path,showScriptName为false,;$this->createUrl()生成的url都是对的,但是访问不了页面,还是必须要加上index.php就可以了.

当然.htaccess也按照guide写好了的.与index.php同一目录

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

http://leo/yii/yii/i…php/test/admin 可以访问

http://leo/yii/yii/test/admin 不能访问

你的服务器配置允许你使用.htaccess么?这个应该是服务器配置的问题。

果然是没有打开mod_rewrite.

前不久我做了一个整理,就是针对format url+ hidden index.php这些的。希望对你有帮助。

点我