apache url重写问题

syzd 2007-04-03 12:29:54
鄙人想实现访问www.b.com/index.jsp/s2/p8重写成www.b.com/index.jsp?action=2&pageno=8 应该要怎样配置,我使用了下面方式可以实现
RewriteRule index.html/s(\d+)/p(\d+) index.jsp?action=$1&pageno=$2
但我配置成这样
RewriteRule ^index.html/s(\d+)/p(\d+)$ index.jsp?action=$1&pageno=$2
为什么就不成功呢就只多了^和$而已,请高人指教
...全文
603 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wolf00781 2007-04-06
  • 打赏
  • 举报
回复
syzd 2007-04-03
  • 打赏
  • 举报
回复
再补充:
我是这样配置的
DocumentRoot D:\workspace\apachetest\WebRoot
ServerName www.b.com
ServerAlias b.com
DirectoryIndex index.html index.jsp
syzd 2007-04-03
  • 打赏
  • 举报
回复
感谢各位!
/s(\d+)/p(\d+)$ index.jsp\?action=$1\&pageno=$2
这种成功.
但不是很明白是什么原因啊!
我是没有使用RewriteBase /的,是不是跟这个有关系
chinalinx 2007-04-03
  • 打赏
  • 举报
回复
RewriteRule /s(\d+)/p(\d+)$ index.jsp\?action=$1\&pageno=$2
CapricornZeus 2007-04-03
  • 打赏
  • 举报
回复
RewriteRule ^index.html/s(\d+)/p(\d+)$ index.jsp?action=$1&pageno=$2

至少应该是
RewriteRule ^/index.html/s(\d+)/p(\d+)$ index.jsp?action=$1&pageno=$2

多一个"/" 别的没测试。
syzd 2007-04-03
  • 打赏
  • 举报
回复
怎么没人回答啊,只有换网站问那

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧