欢迎光临景诺科技软件开发淘宝店

进店请收藏,谢谢

NGINX重定向改为apache重定向

自己写的,需要测试下才知道可不可以。

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]

更多

本文固定链接: http://shanmao.me/webservice/nginx-zhong-ding-xiang-gai-wei-apache-zhong-ding-xiang | 山猫的博客

该日志由 admin 于2014年07月31日发表在 nginx, 服务器端 分类下,
原创文章转载请注明: NGINX重定向改为apache重定向 | 山猫的博客