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

    (@tdmalone)

    Actually, on further digging, this is the way Simply Static works ??

    The redirect is created in includes/tasks/class-ss-fetch-urls-task.php in the handle_30x_redirect() function. As part of this, a redirect page is created similar to the above.

    This (sort of) works for HTML files, but doesn’t work for XML files.

    The reason is only sort of works for HTML files is that the server will still send a 200 OK response, which is not really a 301/302 redirect.

    Of course we could write a custom script to pick up this template and do custom logic to create a 30x instead, but I wonder if there’s anything else Simply Static can do to help here. Maybe a filter to modify this behaviour – or at least to change the template without needing to edit the plugin’s views directly?

    Just thinking out loud here, not sure yet what the best solution is or whether it even should be part of Simply Static.

    Thread Starter tdmalone

    (@tdmalone)

    A couple of other findings in case they help others:

    – You _must_ use absolute URLs if you’re using sitemaps (with Yoast at least). If you’re using relative URLs, Google will complain that the links in the sitemaps are invalid.
    – Simply Static will still follow all the links to the other sitemaps, so you only need to include https://example.com/sitemap.xml in your Additional URLs setting.
    – I’m currently working around the 301 redirect issue by just manually ‘moving’ sitemap_index.xml to sitemap.xml before I sync to my host.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using with Yoast sitemaps (and 301 redirections)’ is closed to new replies.