{"id":10049671,"date":"2018-03-07T16:58:58","date_gmt":"2018-03-07T16:58:58","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/problem-with-my-sitemap\/"},"modified":"2018-03-07T16:58:58","modified_gmt":"2018-03-07T16:58:58","slug":"problem-with-my-sitemap","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/problem-with-my-sitemap\/","title":{"rendered":"Problem with my sitemap"},"content":{"rendered":"<p>Hi.<\/p>\n<p>I&#8217;haven&#8217;t noticed it before, but since the 6.3.0 release I have a problem with my sitemaps.<\/p>\n<p>I use WordPress in multisite mode to generate static files with <a href=\"https:\/\/fr.wordpress.org\/plugins\/simply-static\/\" rel=\"noopener noreferrer\" target=\"_blank\">this plugin<\/a> and use the sitemaps to improve the indexing process.<\/p>\n<p>I have added this line in my wp-config: <code>define(&quot;WP_CONTENT_URL&quot;, &quot;https:\/\/cdn.theconcept.fr&quot;);<\/code><br \/>\nBTW all the common resources (themes, plugins, js, etc.) for my static websites are shared by all the generated files.<\/p>\n<p>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 :(&#8230;<br \/>\nSo, in my generated xml file I have the path to XSL file like this<br \/>\n<code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;?xml-stylesheet type=&quot;text\/xsl&quot; href=&quot;\/\/cdn.theconcept.fr\/wp-content\/plugins\/wordpress-seo\/css\/main-sitemap.xsl&quot;?&gt;<\/code><br \/>\nbut the path to the XML files link to mydomain.theconcept.fr generating the &#8220;common&#8221; error:<br \/>\n&#8220;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.&#8221;<\/p>\n<p>I have seen that the concerned function is the one below in inc\/sitemaps\/class-sitemaps-renderer.php<\/p>\n<pre><code>protected function get_xsl_url() {\n\tif ( home_url() !== site_url() ) {\n\t\treturn home_url( &#039;main-sitemap.xsl&#039; );\n\t}\n\treturn plugin_dir_url( WPSEO_FILE ) . &#039;css\/main-sitemap.xsl&#039;;\n}<\/code><\/pre>\n<p>Is there&#8217;s a hook or a tips to avoid the path to the plugin but rather the root of my websites, please?<\/p>\n<p>TIA for your help.<\/p>\n<p>Pierre.<\/p>\n","protected":false},"template":"","class_list":["post-10049671","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10049671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10049671\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10049671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}