• Resolved Elias

    (@eliaslange)


    Hi.

    I have noticed that the option add sitemap to robots.txt is adding the sitemap right at the end of the last entry in the robots.txt which might cause some problems with the rules implemented. It would be better to include the sitemap on the next row/line after the last entry.

    Cheers,
    Elias

    The page I need help with: [log in to see the link]

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @alignak,

    Thanks for the quick update!

    Unfortunately, function fastvelocity_min_html_compression_start still runs with the current implementation, which causes the issue.

    My suggestion would be adding the fastvelocity_exclude_contents exclusion check there, too. I just tested that out and it works great. Cheers!

    Hi @cybr

    Thanks for the tip.

    I have this on fastvelocity_exclude_contents and it should match any .txt file by url. If that is not working, what is the code that you said you used and works?

    # robots.txt and xml dynamically generated sitemaps
    if(isset($_SERVER['REQUEST_URI']) && (substr($_SERVER['REQUEST_URI'], -4) == '.txt' || substr($_SERVER['REQUEST_URI'], -4) == '.xml')) { return true; }

    Thanks,

    Raul

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @alignak,

    The annotated code from fastvelocity_exclude_contents works as intended ??

    However, this line still runs at the end of the fvm.php file:

    add_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
    

    Called function fastvelocity_min_html_compression_start doesn’t have the exclusion check.

    So, my suggestion is this:

    function fastvelocity_min_html_compression_start() {
    	// Add this line at the start:
    	if ( fastvelocity_exclude_contents() ) return;
    
    	//[...code here...]
    }

    I hope this is a little bit clearer ?? Cheers!

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Sitemap in robots.txt’ is closed to new replies.