最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
三种apache Rewrite url配置方法
时间:2011-05-31 编辑:简简单单 来源:一聚教程网
三种apache Rewrite url配置方法
方案1:最简单,不用配置Apache
URI效果:http://movie.example.com/index.php/subject/4843637/
案例:MediaWiki
todo
方案2:配置Apache URL rewrite,重定向至index.php,带参数
URI效果:http://movie.example.com/subject/4843637/
案例:MediaWiki
todo
方案3:配置Apache URL rewrite,重定向至index.php,无参数
URI效果:http://movie.example.com/subject/4843637/
todo
资料:配置Apache URL rewrite的两种方式
1、.htaccess文件(不重启Apache)
适用范围:虚拟主机等无法重启Apache的情况
步骤:开启Apache conf里的AllowOverride All(虚拟主机一般都已经开启),
把RewriteRule写入.htaccess文件,放在web访问的目录里。
2、Apache conf(重启Apache)
适用范围:VPS等可以重启Apache的情况
步骤:把RewriteRule写入httpd.conf或者httpd-vhosts.conf文件
PS:
想起来上学的时候,在虚拟主机(Web Hosting)上,不能重启Apache,想配置rewrite,去图书馆里翻了很多书都没有找到。后来在网上学习到.htaccess,一直没有记录下来。
后来做项目一直是配Apache conf。前几天同事问我:没有配置Apache,为啥就能用撇斜杠/传参数,像index.php/id/123/。
-
上一个: js 鼠标放上时改变背景
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31