每年都要做很多老网站升级永易搜CMS的网站,主要的步骤就是:1、导入老程序的数据 2、原来的链接如果与新链接结构有差异的做一下301重定向。这是一个ngnix的服务器,所以要用到下边的规则:
location / { rewrite ^/software/(12|13|14|15|16|66|84|90|93).html$ http://www.weijingtai.org/software/yy/$1.html permanent; rewrite ^/software/(21|22|23|24|77|86|87|89).html$ http://www.weijingtai.org/kf/$1.html permanent; if (!-f $request_filename) { rewrite ^/(tag/.+|tag)/$ /tag.php?path=$1 last; rewrite ^/(tag/.+)/list_([0-9]+).html$ /tag.php?path=$1&p=$2 last; rewrite ^/s/$ /search.php last; rewrite ^/([a-zA-Z0-9/_]+)/$ /list.php?path=$1 last; rewrite ^/([a-zA-Z0-9/_]+)/list_([0-9]+).html$ /list.php?path=$1&p=$2 last; rewrite ^/([a-zA-Z0-9/_]+)/([a-z0-9-_]+).html$ /content.php?path=$1/$2.html last; rewrite ^/([a-zA-Z0-9-_]+).html$ /topic.php?path=$1 last; rewrite ^/(sitemap|rss).xml$ /api/$1.xml.php last; } } location ~ /.ht { deny all; }
还没有人来评论,快来抢个沙发吧!