为避免之前文章内的链接和搜索引擎收录的链接失效,我们再可以将之前的链接301跳转到新链接。
例如之前固定链接是/%category%/%post_id%
链接形式:https://www.liitk.comcategory/123
因为加了cdn缓存更改成了/%post_id%.html
链接形式:https://www.liitk.com123.html
用宝塔内的重定向为例
重定向类型选择 路径,重定向路径:/category/
目标url: https://www.liitk.com.html
然后发现这样子跳转并不完美,这里我们修改配置文件实现完美跳转
文章完美跳转
例如:www.liitk.com/categorys/123 301完美跳转到 www.liitk.com/123.html
#REWRITE-START
rewrite ^/archives/(.*) https://www.liitk.com$1.html/ permanent;
#REWRITE-END
还有百度的mip页面(用下面的即可完美跳转)
#REWRITE-START
rewrite ^(.*)/mip.html/ https://www.liitk.com$1.html/mip/ permanent;
#REWRITE-END
谷歌的AMP跳转
#REWRITE-START
rewrite ^(.*)/amp.html/ https://www.liitk.com$1.html/amp/ permanent;
#REWRITE-END
注:把网址替换成自己的网站!
特别声明:本站大部分资源来源于网络,如若本站内容有侵犯了原著者的合法权益,请联系邮箱"admin@liitk.com"提供证明并给予删除处理!