免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1687 | 回复: 2
打印 上一主题 下一主题

[Web] 关于apache 重写问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-19 14:44 |只看该作者 |倒序浏览
我想实现 test.abc.com  转为 www.abc.com/index.php?uid_1.html
以下是我的配置文件,已经测试成功。
RewriteEngine on
RewriteCond %{HTTP_HOST} ^test\.abc\.com$
RewriteRule ^/$ http://www\.abc\.com/index.php?uid_1.html [R]
RewriteCond %{HTTP_HOST} ^test2\.abc\.com$
RewriteRule ^/$ http://www\.abc\.com/index.php?uid_2.html [R]
RewriteCond %{HTTP_HOST} ^test3\.abc\.com$
RewriteRule ^/$ http://www\.abc\.com/index.php?uid_3.html [R]

我是想 将这样的一个关系保存到 一个 txt 中。我该怎么做


大侠们,帮我下啊!

论坛徽章:
0
2 [报告]
发表于 2007-12-19 14:50 |只看该作者
什么叫保存到一个txt中?不懂你的意思哦。

论坛徽章:
0
3 [报告]
发表于 2007-12-19 14:56 |只看该作者
保存到 txt 中就是建立一个 txt文档,里面记录着 对应关系
比如:
访问的url                           转到的url
test.abc.com                    www.abc.com/index.php?uid_1.html
test2.abc.com                  www.abc.com/index.php?uid_2.html
test3.abc.com                  www.abc.com/index.php?uid_3.html
     ...                                              ...

apache通过读取里面的文件 来做url转发。明白?
应该可以这样做吧!
我知道二级域名就可以这样做!但url转发怎么做呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP