Wordpressで運営しているあるサイトのホスティングサーバー(1&1)を移行したところ、
RSSの取得でエラーが出るようになりました。
以下2点の環境では問題なく取得できています、
・旧サーバーホスティング会社
・ローカル環境
実行しようとしたコードは下記になります。
php
1$feed = fetch_feed('https://www.example.com/index.rdf'); 2print_r($feed);
表示されたエラー
WP_Error Object ( [errors] => Array ( [simplepie-error] => Array ( [0] => A feed could not be found at https://www.example.com/index.rdf. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed. ) ) [error_data] => Array ( ) ) Error Occurred while acquiring feed data!
debug.log に出力された内容
[29-May-2018 09:40:35 UTC] PHP Notice: A feed could not be found at https://www.example.com/index.rdf. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed. in ~/htdocs/wordpress/wp-includes/class-simplepie.php on line 1555
取得する拡張子がrdfだとダメなようで、
他のrdf拡張子のURLから取得しようとしても同様のエラーが出ています。
ホスティング会社の勧めにしたがい、htaccessを旧サーバーから移行してみても結果は変わらず。
何かTryすべきこと、思いついたこと等がある方おりましたら、
お教えいただけると嬉しいです。
どうぞよろしくお願いいたします。
小西