如何在Yii Framework中删除index.php [英] How to remove index.php in Yii Framework

查看:58
本文介绍了如何在Yii Framework中删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆