Problem with my sitemap
-
Hi.
I’haven’t noticed it before, but since the 6.3.0 release I have a problem with my sitemaps.
I use WordPress in multisite mode to generate static files with this plugin and use the sitemaps to improve the indexing process.
I have added this line in my wp-config:
define("WP_CONTENT_URL", "https://cdn.theconcept.fr");
BTW all the common resources (themes, plugins, js, etc.) for my static websites are shared by all the generated files.My problem is that in the new Yoast release if the home_url is the same that the site_url, you use the path to your plugin for the XSL file :(…
So, in my generated xml file I have the path to XSL file like this
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//cdn.theconcept.fr/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
but the path to the XML files link to mydomain.theconcept.fr generating the “common” error:
“Unsafe attempt to load URL https://cdn.theconcept.fr/plugins/wordpress-seo/css/main-sitemap.xsl from frame with URL https://mydomain.theconcept.fr/sitemap_index.xml. Domains, protocols and ports must match.”I have seen that the concerned function is the one below in inc/sitemaps/class-sitemaps-renderer.php
protected function get_xsl_url() { if ( home_url() !== site_url() ) { return home_url( 'main-sitemap.xsl' ); } return plugin_dir_url( WPSEO_FILE ) . 'css/main-sitemap.xsl'; }
Is there’s a hook or a tips to avoid the path to the plugin but rather the root of my websites, please?
TIA for your help.
Pierre.
- The topic ‘Problem with my sitemap’ is closed to new replies.