WordPress SEO denilince ilk başlarda akla gelen Yoast SEO 1+ milyondan fazla sistemde aktif olarak kullanılıyor. Her ne kadar eklentinin kurulu olduğu andaki ayarları en stabil ayarlar olsa da bazen küçük sorunlar çıkabiliyor.
Bu sorunların en başında olan ise Yoast Sitemap 404 hatası , eklentinin bize verdiği sitemap url’sine tıklandığında 404 hatası veriyor.
Aşağıdaki kodları .htaccess dosyasına girdiğiniz zaman sorununuz tamamen ortadan kalkacaktır.
Eğer Apache kullanıyor iseniz ;
# Yoast SEO – XML Sitemap Rewrite Fix 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] # END Yoast SEO – XML Sitemap Rewrite Fix |
Eğer NGINX kullanıyor iseniz ;
#Yoast SEO Sitemaps location ~ ([^/]*)sitemap(.*).x(m|s)l$ { ## this redirects sitemap.xml to /sitemap_index.xml rewrite ^/sitemap.xml$ /sitemap_index.xml permanent; ## this makes the XML sitemaps work rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last; rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; ## The following lines are optional for the premium extensions ## News SEO rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last; ## Local SEO rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last; rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last; ## Video SEO rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last; } |