如何在Yii Framework中删除index.php [英] How to remove index.php in Yii Framework
问题描述
伙计们,我是Yii框架的新手.我想从我的网址中删除index.php.按照yii文档,当我将重写引擎代码放入.htaccess文件中并将config/main.php文件中的showScriptName设置为false时,出现500内部服务器错误.我的.htaccess文件位于应用程序的根文件夹中.告诉我我在哪里做错了
Hey guyz i am a newbie in Yii framework. I want to remove the index.php from my urls. Following the yii documentation when i put the rewrite engine code in my .htaccess file and setting showScriptName to false in my config/main.php file i get the 500 internal server error. My .htaccess file is located in root folder of my application. Tell me where i am doing wrong
更新:
这是我的.htaccess文件中的代码:
This is the code in my .htaccess file:
# 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://www.yiiframework. com/doc/guide/1.1/en/topics.url#hiding-x-23x
这篇关于如何在Yii Framework中删除index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!