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

进店请收藏,谢谢

nginx伪静态备份

WP博客伪静态,万能伪静态:

 rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;

if (!-e $request_filename) {

rewrite ^.+?(/wp-.*) $1 last;

rewrite ^.+?(/.*\.php)$ $1 last;

rewrite ^ /index.php 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;

齐博cms 580gk.cn 伪静态

 location /{
                #rewrite ^/bencandy-city_id-(\d+)-fid-(\d+)-id-(\d+).html$  /bencandy.php?city_id=$1&fid=$2&id=$3 last;
                #rewrite ^/list-city_id-(\d+)-fid-(\d+).html$  /list.php?city_id=$1&fid=$2 last;
                #rewrite ^/list-city_id-(\d+)-fid-(\d+)-sortid-(\d+).html$  /list.php?city_id=$1&fid=$2&sortid=$3 last;
                rewrite ^(.*)/(list|bencandy)-([^\.]+)\.([a-zA-Z0-9]+)$ $1/$2.php?stringID=$3 last;
        }

此文用作记录,还为以后写ng伪静态做参考。

以下是apache htaccess 赚nginx rewrite规则

Options -Indexes
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(?!rewrite.php)(.*)$ /rewrite.php?rewrite=$1&%1 [L]

转换后:

if ($args ~ "^(.*)$"){
	set $rule_0 1$rule_0;
	set $bref_1 $1;
}
if ($rule_0 = "1"){
	rewrite ^/(?!rewrite.php)(.*)$ /rewrite.php?rewrite=$1&$bref_1 last;
}

转换网址:http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

更多

本文固定链接: http://shanmao.me/seo/nginx-wei-jing-tai-bei-fen | 山猫的博客

该日志由 admin 于2014年10月09日发表在 linux, nginx, SEO 分类下,
原创文章转载请注明: nginx伪静态备份 | 山猫的博客