<span id="hiksd"><pre id="hiksd"></pre></span>
  1. <dd id="hiksd"><track id="hiksd"></track></dd>
  2. <rp id="hiksd"><object id="hiksd"><input id="hiksd"></input></object></rp>

    <th id="hiksd"><pre id="hiksd"></pre></th>
    <em id="hiksd"><acronym id="hiksd"></acronym></em>

      <ol id="hiksd"><object id="hiksd"><input id="hiksd"></input></object></ol>
    1. <dd id="hiksd"></dd>

      wordpress怎么生成網站地圖?如何利用Yoast SEO生成XML站點地圖

      wordpress是國外的cms,許多站長都會使用wordpress建一個個人博客。對于新手朋友來說,wordpress建站可以讓我們更好的熟悉網站結構。同時wordpress也有很多功能強大的插件。今天要和大家介紹的是wordpress怎么生成網站地圖,網站地圖是一個網站的脈絡,搜索引擎通過網站地圖可以更好的識別網站內容。下面教大家如何利用Yoast SEO生成XML站點地圖,Yoast SEO插件是個功能非常強大的插件,現在也有漢化版的。

      1、首頁你要下載一個Yoast SEO插件,然后在設置里面可以找到xml sitemaps,點擊小問號會出現查看網站地圖的提示

      由于XML站點地圖的重要性,我們已將此功能添加到我們的Yoast SEO插件中。XML站點地圖可用于插件的免費版和高級版。

      Yoast SEO會自動為您的網站創建一個XML網站地圖。你可以通過點擊’SEO’找到它,然后選擇WordPress安裝側邊欄中的’Features’選項卡:

      Yoast SEO中的XML站點地圖

      在此屏幕中,您可以啟用或禁用網站的XML站點地圖。除此之外,您可以單擊問號來展開信息并查看更多可能性,例如在瀏覽器中檢查XML站點地圖:

      2、你可以設置想要出現在網站地圖里面的內容,搜素外觀把一些不想出現的網站目錄弄成NO或者否

      如果您想從XML站點地圖中排除內容類型,您可以在“搜索外觀”選項卡中執行此操作。如果您選擇“否”作為“在搜索結果中顯示X?”的答案?這種類型的內容不會被排除在XML站點地圖中。?排除帖子類型xml sitemap yoast seo

      3、最后的網站地圖有時點擊會出現404的提示,下面是一個解決方法

      操作環境

      服務器操作系統:Ubuntu Linux

      Web 服務器:Nginx 或 Apache

      Web 應用:WordPress

      我使用的固定鏈接形態為“樸素”型,如下:

      https://zhaokaifeng.com/?p=3095

      問題描述

      我在我的個人網站上安裝了 YoastSEO, 但是開啟其 XML Sitemap 功能后,訪問:https://zhaokaifeng.com/sitemap_index.xml
      卻出現了 “404 Not Found” 的提示。

      問題分析

      YoastSEO 生成的 XML Sitemap 地址一般是這樣的:

      https://zhaokaifeng.com/sitemap_index.xml

      但其實,在上面這個地址的背后,YoastSEO 生成的 XML Sitemap 的真實地址是這樣的:

      https://zhaokaifeng.com/?sitemap=1

      因此,如果你能通過?example.com/?sitemap=1?正常打開 XML Sitemap, 那就說明你的 XML Sitemap 已經生成了,但是服務器的重寫沒有生效。這種情況下,我們可以使用下面的方法在 Nginx 或者 Apache 上解決該問題。

      Nginx 服務器解決方案

      登錄服務器,進入?/etc/nginx/sites-available?目錄,編輯?default?文件 (重要提示:編輯前請做好備份,以便需要時回滾數據?。?!),將如下代碼寫入當前站點正在使用的?Server{}?塊中:

      #Yoast SEO Sitemaps
      location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
      ## this rewrites 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?yoast-sitemap-xsl=$1 last;
      rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
      rewrite ^/([^/]+?)sitemap([09]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
      }

      之后重啟 Nginx 服務器:

      service nginx restart

      此時再訪問 https://zhaokaifeng.com/sitemap_index.xml 就可以看到 XML 站點地圖已經能夠正常顯示,如圖 1:

      圖 1. 荒原之夢的站點地圖首頁

      Apache 服務器解決方案

      如果你使用的 Web 服務器是 Apache, 則可以在?.htaccess?文件中 WordPress 重寫規則的下面添加如下重寫規則:

      # 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([09]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
      RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 [L]
      # END Yoast SEO – XML Sitemap Rewrite Fix
      其實這個東西如果有ecs或者vps服務器的話,可以將這個重寫規則放進偽靜態里面去
      如何生成網站地圖
      wordpress怎么生成網站地圖?如何利用Yoast SEO生成XML站點地圖就和大家分享到這里,下期再見。

      版權聲明:文章由廣州SEO博客整理侵刪!轉載請注明:誠哥博客 » wordpress怎么生成網站地圖?如何利用Yoast SEO生成XML站點地圖

      贊 (0)
      国产免费片久久精品_国产精品三级小泽玛利亚_国产自愉自愉24区_国产一区二区精品99

        <span id="hiksd"><pre id="hiksd"></pre></span>
      1. <dd id="hiksd"><track id="hiksd"></track></dd>
      2. <rp id="hiksd"><object id="hiksd"><input id="hiksd"></input></object></rp>

        <th id="hiksd"><pre id="hiksd"></pre></th>
        <em id="hiksd"><acronym id="hiksd"></acronym></em>

          <ol id="hiksd"><object id="hiksd"><input id="hiksd"></input></object></ol>
        1. <dd id="hiksd"></dd>