免费注册 查看新帖 |

Chinaunix

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

[Web] apache url rewrite 问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-28 11:29 |只看该作者 |倒序浏览
我在httpd.conf中:
AddModule mod_rewrite.c
RewriteEngine on
RewriteLog "/usr/local/apache/logs/rewrite.log"
RewriteLogLevel 9
RewriteRule component\/option\,(.*) index2\.php\?option=$1 [N,L]

启动apache没有问题, 也有 rewrite.log, 但是空的, 我尝试visit http://192.168.100.2/component/option,test 时, 期望它能rewrite 为 http://192.168.100.2/index2.php?option=test ,但好象rewrite没有生效似的,另外, rewrite.log一直是空的,请问是那里出错吗?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
2 [报告]
发表于 2005-01-28 12:57 |只看该作者

apache url rewrite 问题

你loadmodule这个模块了没有啊?

论坛徽章:
0
3 [报告]
发表于 2005-01-28 13:55 |只看该作者

apache url rewrite 问题

我刚才已经解决了问题,不用LoadModule, 我原是用VirtualHost, 需要在VirualHost 加上
RewriteEngine on
RewriteLog "/usr/local/apache/logs/rewrite.log"
RewriteLogLevel 9
RewriteRule component\/option\,(.*) index2\.php\?option=$1 [N,L]

才能生效. 另外,
RewriterRule 能否实现 如:
component/pars1, value1/pars2,value2/...../parsN,valueN 为:
index2.php?pars1=value1&pars2=value2&...&parsN,valueN
中间的参数是不定的

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
4 [报告]
发表于 2005-01-28 21:07 |只看该作者

apache url rewrite 问题

可以实现,不过你需要看看正则表达式的内容

论坛徽章:
0
5 [报告]
发表于 2005-01-29 23:20 |只看该作者

apache url rewrite 问题

这正是我想用rewriter实现的问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP