自己写的,需要测试下才知道可不可以。
[code]
rewrite ^/index.(html|htm)$ /index.$1 last;
rewrite ^/index_(hot|new)(_(\d+))?.html$ /index.php?ac=index&st=$1&page=$3 last;
rewrite ^/index_(\d+).html$ /index.php?ac=index&page=$1 last;
rewrite ^/([a-zA-Z]+)_(new|hot)(_(\d+))?.html$ /index.php?ac=$1&st=$2&tid=$4 last;
rewrite ^/([a-zA-Z]+)_(new|hot)_(\d+)_(\d+).html$ /index.php?ac=$1&st=$2&tid=$3&page=$4 last;
rewrite ^/([a-zA-Z]+)_(\d+)_(\d+).html$ /index.php?ac=$1&tid=$2&page=$3 last;
rewrite ^/([a-zA-Z]+)(_(\d+))?.html$ /index.php?ac=$1&tid=$3 last;
RewriteEngine On
RewriteRule ^/index.(html|htm)$ http://www.xxx.com/index.$1 [R=301]
RewriteRule ^/index_(hot|new)(_(\d+))?.html$ http://www.xxx.com/index.php?ac=index&st=$1&page=$3 [R=301]
RewriteRule ^/index_(\d+).html$ http://www.xxx.com/index.php?ac=index&page=$1 [R=301]
RewriteRule ^/([a-zA-Z]+)_(new|hot)(_(\d+))?.html$ http://www.xxx.com/index.php?ac=$1&st=$2&tid=$4 [R=301]
RewriteRule ^/([a-zA-Z]+)_(new|hot)_(\d+)_(\d+).html$ http://www.xxx.com/index.php?ac=$1&st=$2&tid=$3&page=$4 [R=301]
RewriteRule ^/([a-zA-Z]+)_(\d+)_(\d+).html$ http://www.xxx.com/index.php?ac=$1&tid=$2&page=$3 [R=301]
RewriteRule ^/([a-zA-Z]+)(_(\d+))?.html$ http://www.xxx.com/index.php?ac=$1&tid=$3 [R=301]
[/code]