301 redirect and 302 redirect

The 301 redirect is “permanent redirect” and “permanent transfer”, while the 302 redirect is “temporary redirect” and “temporary transfer”.

Consider that a URL set to 301 redirect will not appear in the index. However, the 301 redirect takes over the information of the transfer source (old URL) to the transfer destination (new URL).

google search consoleでrobots.txtとsitemap.xmlを管理

まずsitemap.xmlを作る
changefreqで更新頻度
lastmodifyを動的に出したいが、ここではなし

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<!--  created with free sitemap generation system www.sitemapxml.jp  --> 
<url>
  <loc>http://online-shopping.cloud/</loc>
  <priority>1.0</priority>
  <changefreq>always</changefreq>
</url>
<url>
  <loc>http://online-shopping.cloud/ranking.php</loc>
  <priority>0.9</priority>
  <changefreq>daily</changefreq>
</url>
<url>
  <loc>http://online-shopping.cloud/tweet.php</loc>
  <priority>0.8</priority>
  <changefreq>always</changefreq>
</url>
<url>
  <loc>http://online-shopping.cloud/model.php</loc>
  <priority>0.5</priority>
  <changefreq>hourly</changefreq>
</url>
</urlset>

次にrobots.txtでsitemap.xmlを知らせる

User-agent: *Sitemap: http://online-shopping.cloud/sitemap.xml

google search console
ダッシュボードのクロール -> robots.txt テスター