• Hello,
    We are under a multisite wordpress installation and we are trying to use rewrite rules to point to our sitemap.xml in the following form(www.example.com/sitemap.xml).
    Each site has its own sitemap.xml.
    We are currently achieving this by using wp_redirect and we end up with url like this: https://www.example.com/wp-content/themes/theme_name/sitemaps/blog_id/sitemap.xml.
    We tried hiding the url to just show sitemap.xml with no success by using WP_Rewrite in functions.php.
    Any ideas on how we could make this work without using htaccess(since this is a multisite installation).
    Thank you.

Viewing 1 replies (of 1 total)
  • You could simply use an XML sitemap plugin that supports multisite. Let the plugin do the work and you won’t need to worry about custom scripts.

    You don’t want that long URL. You want example.com/sitemap.xml, because that’s what you want to register with Google and Bing.

    All in One SEO Pack supports XML sitemaps for WordPress multisite. Simply download the plugin, network activate, then activate the Sitemaps module for each site in the network under the All in One General Settings panel and run the sitemap.xml generator for each site.

Viewing 1 replies (of 1 total)
  • The topic ‘Sitemap.xml wp rewrite rules’ is closed to new replies.