• Resolved te-deum

    (@te-deum)


    Hello,

    I add a new sitemap to the defaults sitemaps and I can’t access this new sitemap because of 404 errors on URL.

    Here is my code :

    add_filter('bwp_gxs_rewrite_rules', 'add_rewrite_rules');
    function add_rewrite_rules()
    {
    	$my_rules = array(
    		'links\.xml' => 'index.php?gxs_module=link'
    	);
    	return $my_rules;
    }
    
    add_action('bwp_gxs_modules_built', 'bwp_gxs_add_modules');
    function bwp_gxs_add_modules()
    {
    	global $bwp_gxs;
    	$bwp_gxs->add_module('link');
    }

    The sitemap appear but rewrite rule doesn’t work properly.

    For information : I have reset cache and I visit and reset several times the permalinks.
    I use a cache system : WP Super Cache (latest version).

    Thank you for the help.

    https://wordpress.org/plugins/bwp-google-xml-sitemaps/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter te-deum

    (@te-deum)

    While I was writting my message, I realise that rewrite rules is not like BWP show the link !

    BWP show a link.xml link instead of links.xml as I wrote.
    I change my code to :

    add_filter('bwp_gxs_rewrite_rules', 'add_rewrite_rules');
    function add_rewrite_rules()
    {
    	$my_rules = array(
    		'link\.xml' => 'index.php?gxs_module=link'
    	);
    	return $my_rules;
    }

    And everything is now working perfectly.

    Thank you to the team for this great plugin.

    Plugin Author Khang Minh

    (@oddoneout)

    Glad you got it sorted 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom sitemaps with 404 error’ is closed to new replies.