请问Apache有没有url映射功能?
我现在用那个rewrite,但是rewrite是用HTTP/1.1 302 Object Moved状态,然后用Location重定向的,并不能隐藏实际路径,请问有什么办法作到用一个连接映射到另外一个连接上,
例如
一个虚拟地址:http://localhost/1/2/3
而实际地址:http://localhost/1/2.php?id=3
客户端请求http://localhost/1/2/3这个地址的时候,直接把http://localhost/1/2.php?id=3的结果输出给用户,而不是类似于Response.Redirect这样的功能重定向
请问Apache有没有这方面的设置呢?
问题点数:50、回复次数:3Top
1 楼Meteorlet(http://smartdict.cn)回复于 2005-06-04 19:23:58 得分 25
Apache的mod_rewrite 不会显示2.php?id=3的
RewriteEngine On
RuleRewrite /1/((0-9a-z]+)/(0-9)$ /1/$1.php?id=$2Top
2 楼wtogether(wtogether)回复于 2005-06-04 23:38:21 得分 0
那是浏览器不显示,RewriteRule定义的规则,我用自己写的http客户端,可以看到那个实际urlTop
3 楼e2ghost(惜福)回复于 2005-06-06 18:58:10 得分 25
用mod_rewrite,是看不到實際url的吧,這是apache自己處理的,應該不會再把實際的url再返回給客戶端才是。Top




