在APACHE服务器上的访问方式上去除index.php
来源:互联网 发布:快三数据接口 编辑:程序博客网 时间:2024/05/16 12:07
在APACHE服务器上的访问方式上去除index.php
在APACHE服务器上的访问方式上去除index.php
下面我说下 apache 下 ,如何 去掉URL 里面的 index.php
例如: 你原来的路径是: localhost/index.php/index
改变后的路径是: localhost/index
1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
2.在APACHE里面去配置 ,将里面的AllowOverride None都改为AllowOverride All
注意:修改之后一定要重启apache服务。
3.确保URL_MODEL设置为2, (url重写模式)
在项目的配置文件里写
return Array(
‘URL_MODEL’ => ’2′,
);
4 .htaccess文件必须放到跟目录下
这个文件里面加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
补充: windows 里面不能创建 .htaccess , 下面我说下创建方法
新建任何一个文件,然后打开, 点击另存为 (文件类型选择所有),这样就可以创建了
例如: 你原来的路径是: localhost/index.php/index
改变后的路径是: localhost/index
1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
2.在APACHE里面去配置 ,将里面的AllowOverride None都改为AllowOverride All
注意:修改之后一定要重启apache服务。
3.确保URL_MODEL设置为2, (url重写模式)
在项目的配置文件里写
return Array(
‘URL_MODEL’ => ’2′,
);
4 .htaccess文件必须放到跟目录下
这个文件里面加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
补充: windows 里面不能创建 .htaccess , 下面我说下创建方法
新建任何一个文件,然后打开, 点击另存为 (文件类型选择所有),这样就可以创建了
阅读全文
0 0
- 在APACHE服务器上的访问方式上去除index.php
- ubnutu 环境下 在APACHE服务器上的访问方式上去除index.php
- 在Apache服务器上的访问方式上去除index.php
- 在APACHE服务器上的访问方式上去除index.php
- 在APACHE服务器上的访问方式上去除index.php
- 在apache服务器上的访问去除index.php
- 在apache中设置访问目录后进入的默认页面为index.php
- CodeIgniter 框架在Apache服务器下去掉index.php 总结
- 在apache-httpd 部署php 中设置访问目录后进入的默认页面为index.php
- 在阿里云的云服务器上:Linux服务器安装-Apache/nginx+mysql+PHP
- CodeIgniter如何去掉Index.php-apache服务器
- 在apache上安装gitweb实现浏览器访问git服务器
- Apache服务器在linux上的配置
- PHP在Apache下的工作方式
- Apache PHP mairadb 分在3台服务器上
- CI框架在Apache服务器下去掉URL中的index.php
- 在SAE上真正隐藏index.php的方法
- [我的PHP之旅] 02. 在Linux上搭建Apache服务器
- 【Unity3d】在Unity3d中播放视频:AVPro Video的使用
- spring cloud 之Spring Cloud Config 尝鲜
- python统计函数库scipy.stats的用法1/3
- 字符与字符串--字符及转义字符
- 流水账笔记:PE文件格式(手工增加节)
- 在APACHE服务器上的访问方式上去除index.php
- 我国数学基础教育的困境
- 字符与字符串
- 选自器
- oracle之plsql连接oracle配置
- 【Leetcode】【python】Sqrt(x)
- 职场回头草,可吃得?
- JS入门
- 流水账笔记:PE文件格式(导入表注入---手动)