本文目录

因为SAE不可写,所以就无法生成sitemap.xml,只好用插件把sitemap.xml生成在Storage里。我用的是Sitemap For SAE插件,按方法启用插件后是可以生成sitemap.xml但是不知为什么总是看不到最新发表的日志记录。Storage里的sitemap.xml是有最新的日志的,但是http://lengxx.com/sitemap.xml 却看不到,不管怎么强制刷新都没用。

插件的作者说发表文章后再编辑一次就有了,但是我的不管怎么编辑都没有,在另一个sae里的typecho博客里测试后作者的方法是可用的,编辑文章后重新生成了sitemap.xml。不过在这个博客里不管用。手动删除了Storage里的sitemap.xml后在前台访问http://lengxx.com/sitemap.xml 竟然还能看到xml(当然还是缺少新发表的日志的),但是Storage里确定是没有了,真是太无语了。
今天搜索了下,用了emlog的sitemap插件调用Storage里的sitemap.xml的方法,总算是解决了这个问题,方法如下,
上传了sitemap for sae插件后,启用,填入Storage Domain,建立索引文件选择否
在网站根目录建立sitemap.php文件,内容如下,注意把url那行换成你的生成sitemap.xml的storage domain
[cc lang=”php”]

[/cc]

在config.yaml中添加
[cc lang=”xml”]
– rewrite: if ( path ~ “sitemap.xml”) goto “sitemap.php”
[/cc]

如果你用了sitemap for sae之后有和我一样的问题的话可以用下这个方法(不管怎么都没有新发表的日志)
发表文章后再编辑一次才会生成新的sitemap.xml

转载自:http://lengxx.com/post/375.html

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注