yii framework Url: hide index.php
来源:互联网 发布:阿里云 安装包 编辑:程序博客网 时间:2024/05/18 03:51
Maybe it looks simple, but some time ago I need some time to find a solution of this case. I finally got it, and I want to share that I also experienced such cases. So that it can make reference.
Neither let us do the steps:
- Make sure that the hosting / your pc mod_rewrite module is active. if not actively try to activate in a way, open the httpd.conf file. You can check this in the phpinfo.php to find out.
change this setting :
#LoadModule rewrite_module modules/mod_rewrite.so
to be
LoadModule rewrite_module modules/mod_rewrite.so
- then go to .htaccess file, and try to modify to be:
RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
if above does not work try with this:
RewriteEngine on# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# otherwise forward it to index.phpRewriteRule . index.php
- move .htaccess file to root directory, where is index.php thare.
www - protected - index.php - .htaccess
- Set main.php in your yii configuration, at component :
'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'caseSensitive'=>false, ),
- so.., good luck
For reference material I managed to do in my personal website (check my profile).
NB: This for hide index.php
- yii framework Url: hide index.php
- Yii URL隐藏index.php
- yii url重写去掉index.php
- YII如何隐藏URL中的index.php
- Yii+Apache url重写去掉index.php
- Yii Framework隐藏index.php文件的步骤
- Yii隐藏URL中index.php的方法
- yii框架 隐藏index.php 以及美化URL
- yii 隐藏index.php
- Yii隐藏index.php
- YII隐藏index.php
- PHP: Yii 隐藏index.php
- Yii PHP Framework 安装
- Yii PHP Framework
- Yii PHP Framework
- PHP Yii framework
- Yii PHP framework
- PHP-Yii-URL美化
- AES简单实现
- WebUI 2013年产品线解析
- windows xp + cocos2d-x搭建
- do{ ... } while(0)
- JAVASE----05----多态
- yii framework Url: hide index.php
- CString与const char*转换
- C1FlexGrid 模仿 Microsoft Excel 自动计算功能
- 导入android工程@Override报错
- 关于汉字编码问题
- Opencv知识积累
- 阅读pdf时让单面连续阅读
- MP3播放器
- c++例题 构造函数(二)
Total 12 comments
Also, if you're on a virtual directory (e.g. using
on your apache configuration) you MUST use a
statement on your .htaccess file, other than the rewrite won't work again.