+ -
当前位置:首页 → 问答吧 → 100分求apache+tomcat的SEO问题

100分求apache+tomcat的SEO问题

时间:2010-10-18

来源:互联网

apache2.0,tomcat5

在httpd.conf中配置
RewriteRule ^/brand/columnCode_page_(\d+) /app?m=about&columnCode=exh_list&currentPage=$1&pageSize=10 [PT]
currentPage是页数,pageSize是每页显示的行数

然后访问 http://localhost/brand/columnCode_page_1,后台可以正常跳转到 action,浏览器地址栏显示的也是 http://localhost/brand/columnCode_page_1

但是问题来了,当点击“下一页”时,页面地址栏就会变成 http://localhost/app?m=about&columnCode=exh_list&currentPage=2&pageSize=10
下一页是以form表单形式递交

尝试添加配置 RewriteRule ^/app?m=about&columnCode=exh_list&currentPage=(\d+)&pageSize=10 /brand/columnCode_page_$1 [R=301],但是无效。

请问各位大虾,该如何配置才能让action跳转回静态页面的形式?

作者: atremis   发布时间: 2010-10-18

代码是简写形式的URL

href="?m=about&columnCode=exh_list&currentPage=2&pageSize=10"

作者: icy_csdn   发布时间: 2010-10-18

不好意思,回复错了。

作者: icy_csdn   发布时间: 2010-10-18

有两个办法
1. 改写你的分页程序,使分页的形式显示为/brand/columenCode_page_这种形式

2. 通过rewriter, 注意你的规则写错了
RewriteCond %{QUERY_STRING} ^m=about&columnCode=exh_list&currentPage=(\d+)&pageSize=10
RewriteRule ^/app$ /brand/columnCode_page_%1 [R=301]

作者: icy_csdn   发布时间: 2010-10-18