nginx伪静态

rewrite ^/bbs/ba_([0-9]+)\.html$ /bbs/ba.do?baId=$1 last;
rewrite ^/bbs/ba_([0-9]+)_([0-9]+)\.html$ /bbs/ba.do?baId=$1&page=$2 last;
rewrite ^/bbs/topic_([0-9]+)\.html$ /bbs/topic.do?topicId=$1 last;
rewrite ^/bbs/topic_([0-9]+)_([0-9]+)\.html$ /bbs/topic.do?topicId=$1&page=$2 last;
		
rewrite ^/news/([0-9]+)\.html$ /news/newsDetail.do?investNewsId=$1 last;
rewrite ^/news/([0-9]+)_([0-9]+)\.html$ /newsDetail.do?investNewsId=$1&page=$2 last;



对应的apache配置
RewriteRule /news/([0-9]+).html /news/newsDetail.do?investNewsId=$1 [PT]
RewriteRule /news/([0-9]+)_([0-9]+).html /news/newsDetail.do?investNewsId=$1&page=$2 [PT]
RewriteRule /bbs/ba_([0-9]+).html /bbs/ba.do?baId=$1 [PT]
RewriteRule /bbs/ba_([0-9]+)_([0-9]+).html /bbs/ba.do?baId=$1&page=$2 [PT]
RewriteRule /bbs/topic_([0-9]+).html /bbs/topic.do?topicId=$1 [PT]
RewriteRule /bbs/topic_([0-9]+)_([0-9]+).html /bbs/topic.do?topicId=$1&page=$2 [PT]

你可能感兴趣的:(nginx)