使用URL重写,去掉index.php
来源:互联网 发布:淘宝机器人在哪 编辑:程序博客网 时间:2024/05/01 09:22
1、在httpd.conf中打开apache的rewrite模块
#LoadModule rewrite_module modules/mod_rewrite.so
将前面的“#”去掉
将“AllowOverride None”改为“AllowOverride All”
2、在你的app根目录下创建.htaccess内容如下:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# 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
</IfModule>
3、修改config/main.php,在刚才UrlManager组件增加属性showScriptName,值为false.
'urlManager'=>array(
'urlFormat'=>'path', //使用pathinfo模式
'showScriptName'=>false,//不显示脚本名
),
4、重启apache
- 使用URL重写,去掉index.php
- yii url重写去掉index.php
- Yii+Apache url重写去掉index.php
- windows2003 PHP IIS URL重写去掉index.php
- apache2.2.21下配置url地址重写 去掉index.php
- nginx 重写去掉index.php
- nginx 重写去掉index.php
- url中去掉index.php
- 去掉 URL 中的 index.php
- URL如何去掉index.php
- URL重写 省略index.php
- MVC中去掉index.php(优雅的使用url)
- [PHP]去掉CodeIgniter URL中的index.php
- php 去掉Url里的 index.php
- magento 去掉网址 url 中的 index.php
- ThinkPHP去掉URL中的index.php
- CodeIgniter 的url中去掉index.php
- Codeigniter(CI) 去掉 URL 中的 index.php
- 商业应用中Java浮点数的精确计算及表示
- 一步步讲解如何调试vxworks网卡驱动-适合嵌入式初学者
- 测试的
- 13个对Android开发者有帮助的工具和资源
- 如何在运行时添加classpath
- 使用URL重写,去掉index.php
- 上周的一些问题
- JSON for java入门总结
- Android画图之Bitmap(二)
- 生成一个C++对象的成本
- 服务端提供servlet供手机端下载(解决Android系统不能下载问题)
- Android 声明捕获系统的拨号按钮的方法
- VC右键菜单消息响应处理
- 负数的二进制表示方法