假设你已经使用mod_jk2.so整合了Apache2.05x与Tomcat5.x
要完成的功能如下重定向:
将URL http://host/clubClass.jsp?ccID=1 重定向为 http://host/clubClass_1.html
1. 修改Apache2\conf\httpd.conf文件,加载mod_rewrite.so
2. 在每个虚拟主机的地方设置Rewrite参数
要完成的功能如下重定向:
将URL http://host/clubClass.jsp?ccID=1 重定向为 http://host/clubClass_1.html
1. 修改Apache2\conf\httpd.conf文件,加载mod_rewrite.so
程序代码: |
LoadModule rewrite_module modules/mod_rewrite.so |
2. 在每个虚拟主机的地方设置Rewrite参数
程序代码: |
<VirtualHost *:80> ServerAdmin ajie2000@gmail.com ServerName www.javatx.cn RewriteEngine on RewriteRule /clubClass_([0-9]+).html /clubClass.jsp?ccID=$1 [PT] </VirtualHost> |