How to remove index.php in Yii Framework(如何在 Yii 框架中删除 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 框架中删除 index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Yii 框架中删除 index.php


- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01