WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Sitemap: A bug while using a CDN in WP_PLUGIN_URL? (2 posts)

  1. Pothi
    Member
    Posted 1 year ago #

    I use a different URL in WP_CONTENT_URL and in WP_PLUGIN_URL as per the instructions. Those URLs are from a CDN network. So, when the CDN URL is entered in WP_PLUGIN_URL, I get the following error when visiting the sitemap (domainname.com/sitemap_index.xml) using a browser...

    Error loading stylesheet: An unknown error has occurred (805303f4)

    http://cdn.domainname.com/wp-content/plugins/wordpress-seo/css/xml-sitemap-xsl.php

    When I did curl -I http://domainname.com/sitemap_index.xml, it works. Also, Google Webmaster Tools doesn't complain. So, the sitemap works correctly. But, it is not displayed correctly to normal visitors.

    Is there anyway to exclude "wp-content/plugins/wordpress-seo/css/xml-sitemap-xsl.php" to serve from WP_PLUGIN_URL?

    Thanks for any help.

    Pothi

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Pothi
    Member
    Posted 1 year ago #

    Fixed it by replacing the following code...

    $pluginurl = plugin_dir_url( __FILE__ );

    with...

    $pluginurl = preg_replace( '/https?:\/\/[-a-zA-Z0-9.]+\//', home_url('/'), plugin_dir_url( __FILE__ ) );

    in wp-seo.php at line number 59, as of version 1.3.4.4 of this plugin.

    The above fix basically lets the wp-content/plugins/wordpress-seo/css/xml-sitemap-xsl.php to be served from the same domain as the site (without using the CDN domain).

    Hope this helps someone!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic