Support » Plugin: XML Sitemap & Google News » PHP Fatal error with feed-sitemap-pt.php (bot?)

  • Resolved gerd.neumann

    (@gerdneumann)


    Hi,

    I have a several times per day these errors in my error_log:

    
    

    [18-Mar-2022 05:00:24 UTC] PHP Warning: require_once(/srv/data/web/vhosts/www.mysite.org/htdocs/wp-content/plugins/xml-sitemap-feed/views/feed-sitemap-pt.php): failed to open stream: No such file or directory in /srv/data/web/vhosts/www.mysite.org/htdocs/wp-includes/template.php on line 770
    [18-Mar-2022 05:00:24 UTC] PHP Fatal error: require_once(): Failed opening required ‘/srv/data/web/vhosts/www.mysite.org/htdocs/wp-content/plugins/xml-sitemap-feed/views/feed-sitemap-pt.php’ (include_path=’.:/usr/share/php:/srv/data/web/includes’) in /srv/data/web/vhosts/www.mysite.org/htdocs/wp-includes/template.php on line 770`
    `

    I would guess that this comes from kind of a bot trying some fishy things. But this is only a guess.

    I saw in the forum that another user has the some logs: https://wordpress.org/support/topic/white-page-with-wrong-xsl-file/#post-15295283

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, yes this happens when some bot (not a bad one) tries to request a sitemap that does not exist (anymore) in the form of /sitemap-XXX.xml and the plugin tries to load a template file that does not exist. So probably you had previously a sitemap generator that created /sitemap-pt.xml before but now that sitemap is not there anymore while the spider still tries to access it.

    The issue is fixed in the upcoming release.

    But to get rid of the errors in your logs sooner, you could create a (temporary) empty static file “sitemap-pt.xml” and upload it to your site root folder. That will cause the spider to hit an empty response instead of the error.

    Thread Starter gerd.neumann

    (@gerdneumann)

    So probably you had previously a sitemap generator that created /sitemap-pt.xml before but now that sitemap is not there anymore while the spider still tries to access it.

    Nope, been using your plugin for the last 4 years or so. BTW, thank you for making it πŸ™‚

    The issue is fixed in the upcoming release.

    Great πŸ™‚

    Nope, been using your plugin for the last 4 years or so. BTW, thank you for making it πŸ™‚

    Strange, the address /sitemap-pt.xml has never been part of this sitemap plugin. Anyway, another way to work around it for now: if you have a plugin like Redirection active on your site, you can also create a redirection from /sitemap-pt.xml to /sitemap.xml or add this to your .htaccess file:
    Redirect 302 "/sitemap-pt.xml" "/sitemap.xml"

    I can confirm that I have moved from Google XML Sitemaps and all of the dated sub sitemap URL’s (/sitemap-pt-page-2009-08.xml) and (/sitemap-pt-page-2011-11.xml), just to name two as an example return the 500 internal error. I had lots of sub sitemaps. I deactivated and deleted the old sitemap plugin and I have flushed rewrite rules. I can’t have redirects for each separate sitemap URL. Do you know when this fix will be pushed?

    Looking forward to that fix πŸ™‚

    Hi, you can try a regular expression in a rewrite rule like this:

    
    RewriteBase /
    RewriteRule ^sitemap-pt.*\.xml$ https://www.yourwebsite.com/sitemap.xml [R=301,L]
    

    (replace yourwebsite URL)

    It should make the server respond with the sitemap index on all “sitemap-pt” requests.

    Thanks for the quick response and the rewrite rule. Just so I know to look out for your update fix in the next plug-in update. Why are these URL’s still β€œworking” (not 404) even after the old plug-in is deleted?

    The plugin is using a “catch-all” rewrite rule for XML sitemaps. The advantage is les rewrite rules, the downside is (your case) that old or non-existant sitemaps are being processed as if they do exist. In the update, this will be improved πŸ™‚

    That makes sense. Thanks for explaining. Looking forward to the next update πŸ™‚

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.