0

Is it possible to define a redirect for an atom feed? If so, how does one do this? I attempted to simply replace my old atom.xml file with an 301 redirect HTML file, like so:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta rel="canonical" http-equiv="refresh" content="0;url=http://io.carlboettiger.info/2014/atom.xml" />
        <link rel="canonical" href="http://io.carlboettiger.info/2014/atom.xml"/>
  </head>
</html>

and saved this as atom.xml, but (perhaps because of the misleading xml extension?) this doesn't seem to redirect either in the browser or any existing feed reader.

For the RSS format, it looks like the rssboard suggests that an html redirect or an XML-based redirect like so

<redirect>
<newLocation>
http://weblog.infoworld.com/udell/rss.xml
</newLocation>
</redirect>

should do it, but I cannot find any such advice for the atom format. So, how does one define redirects for atom files? (Note: I'm not looking for a hack using .htaccess rewrite rules, since the site is deployed via Github's gh-pages and I don't have the option of custom .htaccess rules anyhow)

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
cboettig
  • 12,377
  • 13
  • 70
  • 113

2 Answers2

2

Is it possible to define a redirect for an atom feed?

Yes, but only through HTTP redirection. In general, this is the best way to redirect a resource on the web.

the site is deployed via Github's gh-pages

As 301 redirect for site hosted at github? indicates, there's no way to specify HTTP redirection for a GH-pages-hosted site.

The Atom spec assumes that you have control over the server, and doesn't define any additional redirection mechanism.

Community
  • 1
  • 1
Joe
  • 29,416
  • 12
  • 68
  • 88
1

Unfortunately I don't know of any standard (be it de-facto) to achieve this. As far as I know, the only way to do so is to find ways to do it at the HTTP level, which you don't control when using Github pages.

Both ways you're trying are documented, but I don't know of any reader which actually implements them. At Superfeedr, we have also seen redirects using the iTunes pattern: <itunes:new-feed-url>.

We've been able to do it using services like cloudflare which will act as proxies and allow you to setup rules for specific pages or addresses.

Julien Genestoux
  • 31,046
  • 20
  • 66
  • 93