| robots.txtの設定方法 |
| robots.txtの設定方法の書き方 |
| robots.txtの設置有無 |
| 結果 | URLの例 | 理由 |
| ○ | http://www.test.com/robots.txt | ルートにありファイル名も正しいため問題ありません。 |
| × | http://www.test.com/dir/robots.txt | ルートにないため間違いとなります。 このケースではサブディレクトリにrobots.txtがあるため間違いとなります。 |
| × | http://www.test.com/robot.txt | 「robots.text」ない(ファイル名に「s」がない)ため間違いです。 testrobots.textなども名前が違うため間違いとなります。 |
| ○ | http://test.com/robots.txt | ルートにありファイル名も正しいため問題ありません。 |
| ○ | http://sub.test.com/robots.txt | サブドメインのルートにありファイル名も正しいため問題ありません。 |
| フィールド | 説明 |
| user-agent | ルールを適用するクローラーを指定します。 どのクローラーにルールを適用するかを指定します。 大文字と小文字は区別されません。 |
| allow | クロールを許可するURLパス。 指定したクローラーにアクセスを許可するパスを指定します。 パスを指定しない場合、ルールは無視されます。 大文字と小文字が区別されます。 |
| disallow | クロールを許可しないURLパス。 指定したクローラーにアクセスを許可しないパスを指定します。 パスを指定しない場合、クローラーはルールを無視します。 大文字と小文字が区別されます。 |
| sitemap | サイトマップの完全な URL。 |
| マーク | 説明 |
| / | ルートおよびその下位にあるすべての URL が一致します。 |
| * | 0 個以上の有効な文字を示します。 |
| $ | URL の末尾を示します。 |
User-Agent: * Disallow: /[上記の解説]
User-Agent: Googlebot Disallow: /[上記の解説]
User-Agent: * Disallow:[上記の解説]
User-Agent: * Disallow: /test/[上記の解説]
| URL | ブロック有無 |
| test.com/test/index.html | 対象ファイルは/test/の下位にあるので、Disallow判定によりブロックされます。 |
| test.com/dir/index.html | 対象ファイルは/test/の下位にないので、Disallow判定の除外によりクロールされます。 |
User-Agent: * Disallow: /*.php$[上記の解説]
| URL | ブロック有無 |
| test.com/test/index.html | 「.php」という拡張子がURLの末尾にないためクロール対象となります。 |
| test.com/test/index.php | 「.php」という拡張子がURLの末尾にあるためブロックされます。 |
| test.com/test/text/index.php | 「.php」という拡張子がURLの末尾にあるためブロックされます。 |
| How to set up robots.txt |
| How to write robots.txt settings |
| Whether robots.txt is installed |
| result | Example URL | reason |
| ○ | http://www.test.com/robots.txt | There is no problem as it is in the root and the file name is correct. |
| × | http://www.test.com/dir/robots.txt | This is incorrect because it is not in the root. In this case, this is incorrect because the robots.txt is in a subdirectory. |
| × | http://www.test.com/robot.txt | This is incorrect because there is no "robots.text" (there is no "s" in the file name). Testrobots.text is also incorrect because it has a different name. |
| ○ | http://test.com/robots.txt | There is no problem as it is in the root and the file name is correct. |
| ○ | http://sub.test.com/robots.txt | There is no problem as it is at the root of the subdomain and the file name is correct. |
| field | description |
| user-agent | Specifies which crawlers the rule applies to. Case-insensitive. |
| allow | URL paths that are allowed to be crawled. Specify the path that the specified crawler is allowed to access. If you do not specify a path, the rule is ignored. Case sensitive. |
| disallow | URL paths that should not be crawled. Specify paths that should not be accessible to the specified crawler. If you do not specify a path, the crawler will ignore the rule. Case sensitive. |
| sitemap | The full URL of the sitemap. |
| mark | description |
| / | Matches the root and all URLs below it. |
| * | Indicates zero or more valid characters. |
| $ | Indicates the end of a URL. |
User-Agent: * Disallow: /[Explanation]
User-Agent: Googlebot Disallow: /[Description]
User-Agent: * Disallow:[Explanation]
User-Agent: * Disallow: /test/[Explanation]
| URL | Block presence/absence |
| test.com/test/index.html | The target is a child of /test/, so it is blocked by the Disallow decision. |
| test.com/dir/index.html | The target is not a child of /test/, so it is blocked by the Disallow decision. |
User-Agent: * Disallow: /*.php$[Explanation]
| URL | Block presence/absence |
| test.com/test/index.html | The URL will be crawled because it does not have the ".php" extension at the end. |
| test.com/test/index.php | It will be blocked because the ".php" extension is at the end of the URL. |
| test.com/test/text/index.php | It will be blocked because the ".php" extension is at the end of the URL. |
| ホームページおよプリ等に掲載されている情報等については、いかなる保障もいたしません。 ホームページおよびアプリ等を通じて入手したいかなる情報も複製、販売、出版または使用させたり、 または公開したりすることはできません。 当方は、ホームペーよびアプリ利用したいかなる理由によっての障害等が発生しても、 その結果ホームページおよびアプリ等を利用された本人または他の第三者が被った損害について 一切の責任を負わないものとします。 |