Yii 删除index.php

Yii 删除index.php,yii,url-rewriting,Yii,Url Rewriting,我在这里看到了教程Yii和一些教程,但都没有解决我的问题。当我尝试在没有index.php的情况下访问web应用程序的任何部分时,它会显示以下内容: 内部服务器错误 服务器遇到内部错误或配置错误,无法正常运行 无法完成您的请求 请通过以下地址与服务器管理员联系:admin@example.com告知 他们了解此错误发生的时间以及您执行的操作 就在这个错误之前 有关此错误的详细信息,请参阅服务器错误 日志 代码的main.php: 'urlManager'=>array(

我在这里看到了教程Yii和一些教程,但都没有解决我的问题。当我尝试在没有index.php的情况下访问web应用程序的任何部分时,它会显示以下内容:

内部服务器错误

服务器遇到内部错误或配置错误,无法正常运行 无法完成您的请求

请通过以下地址与服务器管理员联系:admin@example.com告知 他们了解此错误发生的时间以及您执行的操作 就在这个错误之前

有关此错误的详细信息,请参阅服务器错误 日志

代码的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>',
        ),
    ),

救命啊。谢谢。

确保在Apache配置中安装并启用了
mod_rewrite

另外,请查看Apache的日志,因为它们可能会为您提供更多信息

我个人的htaccess不包括你写的前两行(followsymlinks和indexignore…)

当我在htaccess中出错时,我也有过类似于你的“内部服务器错误”

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NE]