這個問題很莫名其妙,也是昨天晚上在給企業構建響應式網站建設過程中遇到的比較狗血的問題。使用的 WordPress SEO 最佳化外掛當
然還是 Yoast SEO Premium v2.3.5 seo 最佳化外掛,Yoast SEO 不用多說,SEO 中的神器,當然使用的不好,都是燒火棍。事實上
Yoast SEO 和 All in one seo pro 一各有千秋。各位老闆可以查閱文章找到 Yoast SEO Premium 下載地址。
如題,Yoast SEO 生成 Sitemap XML 出現 404 的解決方法。解決方法如下:
第一種方法:先停用 sitemap 功能,然後再啟用
點停用儲存,然後再啟用,發現 sitemap 功能好了。是不是比較狗血。
第二種方法:第一種方法無效時,使用第二種方法
還有一種可能是因為 rewite 的問題,ok,我們來修改規則,開啟網站根目錄的 .htaccess 檔案
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
儲存之後,發現問題解決。