XML Sitemap Generator for Googleで変なページに飛ばされる件
![](https://win2k.org/blog/wp-content/uploads/2023/07/smap.png)
XML Sitemap Generator for Google でHTML形式のサイトマップを無効にすると、sitemap.html に飛んだ時に sitemap.html/ と言うページにリダイレクトされます
![](https://win2k.org/blog/wp-content/uploads/2023/07/smap1.png)
原因は分からないのですが、対処療法を見つけました。プラグインフォルダを開いて以下のファイルを編集します
class-googlesitemapgeneratorloader.php
sitemap-core.php
下記コードの個所をコメントアウトします
$sm_sitemap_name . '(-+([a-zA-Z0-9_-]+))?.html$' => 'index.php?xml_sitemap=params=$matches[2];html=true', 'sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$' => 'index.php?xml_sitemap=params=$matches[2];html=true;zip=true', |
次に、Pluginの設定を開いて更新します。
これで、リダイレクトもされなくなりちゃんと404ページが表示されました。
![WORDPRESS](https://win2k.org/blog/wp-content/uploads/2023/07/image.png)
Comments