WordPress.org

Forums

Atom feed ruturns .php file suffix, not .xml (6 posts)

  1. mmarin
    Member
    Posted 11 years ago #

    In trying to implement the wp-atom.php file to produce an Atom feed, I find that it spits out perfectly fine Atom output, but with a file name of "wp-atom.php," which doesn't display in the browser as most Atom feeds do. Is there a way to get this output to be in the form of "atom.xml"?

  2. Alex King
    Member
    Posted 11 years ago #

    No, it needs to be parsed as PHP to generate the content. Your feed software won't have a problem with it.

  3. Stevarino
    Member
    Posted 11 years ago #

    The content-type headers should tell your browser/agregrater what the file is, not the extension. This is how *.php can send html code without being a *.htm extension.

  4. mmarin
    Member
    Posted 11 years ago #

    Yes, of course PHP needs to parse the file to generate the Atom content, due to the way this Atom support was designed. And yes, it does work. But it's unlike what other software does and is confusing, I think, to users. What I'm asking, and maybe it's more of a PHP question, but is there a way to have PHP return the file as atom.xml after PHP has generated it? I suppose I could add xml to the suffixes that pass through the PHP parser (my HTML files now all are passed to PHP), and then just change the name of the file and the places that reference it. How are other apps doing this? Generating the file every umpteen minutes with a cronjob and saving it as a static file?

  5. Stevarino
    Member
    Posted 11 years ago #

    "I suppose I could add xml to the suffixes that pass through the PHP parser (my HTML files now all are passed to PHP), and then just change the name of the file and the places that reference it."
    That is the best method to achieve what you want. :)
    "How are other apps doing this? Generating the file every umpteen minutes with a cronjob and saving it as a static file?"
    Every time a person comments or a post is edited/created, the files are generated and saved as static xml files. This makes dynamic content difficult to produce in systems like that.

  6. Anonymous
    Unregistered
    Posted 10 years ago #

    mod rewrite.... have
    /atom.xml
    goto
    /wp-atom.php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.