• It appears the plugin is interfering with Yoast SEO. I have a sitemap that is not showing any pages. I have been instructed by Yoast support to look into how to exclude XML sitemaps and XSL stylesheets. I looked into the settings and there is nothing indicating how to do this in W3.

    Could you help me figure this out?

    Thank you.

Viewing 15 replies - 1 through 15 (of 25 total)
  • Plugin Contributor gidomanders

    (@gidomanders)

    Did you activate the Yoast SEO extension in Performance => Extensions? If so, please share your .htaccess file so I can check if the you’re missing something.

    Thread Starter smcllc

    (@smcllc)

    Yes, the Yoast SEO extension is activated.

    What is the best way to safely provide the information to my .htaccess file?

    Plugin Contributor gidomanders

    (@gidomanders)

    Could you check if something like the code below is included in your .htaccess file ABOVE the # BEGIN W3TC ...:

    
    # BEGIN XML Sitemaps
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
    
        RewriteRule ^sitemap.xml$ /sitemap_index.xml [R,L]
        RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
        RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
        RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
        RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
        RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
    </IfModule>
    # END XML Sitemaps
    
    Thread Starter smcllc

    (@smcllc)

    No, this code is no where in my .htaccess file.

    Plugin Contributor gidomanders

    (@gidomanders)

    I think if you add the code to your .htaccess file ABOVE the # BEGIN W3TC ..., your issue is solved. The rules will hit first, before caching kicks in, so the sitemaps will be excluded from cache automatically (caching rules will not be reached due to [L]).

    Thread Starter smcllc

    (@smcllc)

    Ok. Does it matter that there is space in the code you provided between:

    RewriteBase /

    RewriteRule ^sitemap.xml$ /sitemap_index.xml [R,L]

    Also, how can I check to see if it is working?

    Plugin Contributor gidomanders

    (@gidomanders)

    No it doesn’t matter if there is whitespace, as long as they are in the same <IfModule> block.

    You could use htaccess.madewithlove.be to check if you sitemap URL is caught by the new lines of code. Then just deploy and check if your sitemap shows up.

    Thread Starter smcllc

    (@smcllc)

    I used the link to check the sitemap. I inputted my sitemap URL and clicked “Test” and nothing happened.

    Plugin Contributor gidomanders

    (@gidomanders)

    I cannot check it right now because I’m on my way home, but it should display the results somewhere below or next to where you can input the URL and paste the contents of your .htaccess file.

    Thread Starter smcllc

    (@smcllc)

    Yes, I tested it and it is not working. It changed the sitemap URL.

    RewriteRule ^sitemap.xml$ /sitemap_index.xml [R,L] ==> This rule was not met.

    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L] ==> The new url is https://website.com/index.php%3Fsitemap=1
    The tests are stopped because of the L in your RewriteRule options.

    Plugin Contributor gidomanders

    (@gidomanders)

    The fact that it matches the sitemap rule, changes the URL and stops further testing because of the [L] means it works ?? Sorry for the misunderstanding. You can deploy and check if you see the sitemap now!

    Thread Starter smcllc

    (@smcllc)

    I’m still not sure if it is working. I am not seeing any difference in the links. Is there a way to check on this? Thank you!

    Plugin Contributor gidomanders

    (@gidomanders)

    So you don’t see any links but there is a (empty) sitemap showing up? Am I understanding your issue correctly?

    Thread Starter smcllc

    (@smcllc)

    The same links are showing up as before. Nothing has changed.

    Plugin Contributor gidomanders

    (@gidomanders)

    Could you share your wp-content/w3tc-config/master.php file so I can try to replicate the issue?

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘How to exclude XML sitemaps / XSL stylesheets’ is closed to new replies.