Does it have to be ".xml"?

Discussion in 'Google Sitemaps' started by mahmood, Nov 19, 2007.

  1. #1
    I wonder if the sitemap extension has to be ".xml".

    I have created a sitemap with php, will this work?
     
    mahmood, Nov 19, 2007 IP
  2. astup1didiot

    astup1didiot Notable Member

    Messages:
    5,926
    Likes Received:
    270
    Best Answers:
    0
    Trophy Points:
    280
    #2
    astup1didiot, Nov 19, 2007 IP
  3. JagNet

    JagNet Peon

    Messages:
    18
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The sitemap filename doesn't need to be .xml

    .php will be fine, just so long as the content is served as text/xml:
    <?php header('Content-Type: text/xml'); ?>
    Code (markup):
    This way you can easily generate xml sitemaps on the fly using php.
     
    JagNet, Nov 23, 2007 IP
    mahmood likes this.
  4. JochenVandeVelde

    JochenVandeVelde Peon

    Messages:
    412
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    JagNet is right, the extension doesn't matter, it can even be .css or .pdf, as long as you use the right mime-type to serve the content ('Content-Type: text/xml')
     
    JochenVandeVelde, Nov 25, 2007 IP
  5. varunkrish

    varunkrish Peon

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    But doesn't google accept plain text sitemaps with one url per line.
    I agree xml is the best though.
     
    varunkrish, Nov 27, 2007 IP
  6. gigmax

    gigmax Peon

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    http://www.sitemaps.org/protocol.php

    Please read
     
    gigmax, Dec 4, 2007 IP
  7. regalwilliam

    regalwilliam Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Good link on site maps.
     
    regalwilliam, Dec 4, 2007 IP
  8. peejaydee

    peejaydee Peon

    Messages:
    151
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yes, my sitemap is just a txt file - one URL per line. Google webmaster tools show it to be fine with no errors. So text files are fine but difficult to update easily for large or fast-moving sites. Mine is fairly small and rather static so text file works easily.
     
    peejaydee, Dec 14, 2007 IP
  9. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #9
    For a xml sitemap, you can have any name and extension, i.e php asp,
    but for a txt sitemap, yahoo accepts only a fixed name "urllist.txt"
     
    Kuldeep1952, Dec 14, 2007 IP
  10. peejaydee

    peejaydee Peon

    Messages:
    151
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    They also accept "sitemap.txt" .
     
    peejaydee, Dec 15, 2007 IP