gzipping my google sitemaps

Discussion in 'Google Sitemaps' started by TheAlchemist, Jul 23, 2007.

  1. #1
    hello,

    how do I actually gzip my google sitemaps? I use my own script to generate the sitemaps files......

    thanks
     
    TheAlchemist, Jul 23, 2007 IP
  2. davert

    davert Banned

    Messages:
    345
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In Linux, type in: gzip -9 [filename]
     
    davert, Jul 23, 2007 IP
  3. TheAlchemist

    TheAlchemist Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hmmmm....I'm on shared hosting for now.....is there any way I can do that including some function in the script that makes the sitemap?

    thanks
     
    TheAlchemist, Jul 23, 2007 IP
  4. websitetools

    websitetools Well-Known Member

    Messages:
    1,513
    Likes Received:
    25
    Best Answers:
    4
    Trophy Points:
    170
    #4
    Since you use your own script, I assume you wish to continue to do so (and not e.g. switch to my sitemap generator program *G*)

    So, what script language do you use? Have you tried searching Google for e.g. PHP + GZip?
     
    websitetools, Jul 23, 2007 IP
  5. TheAlchemist

    TheAlchemist Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok...I found this:

    http://it2.php.net/manual/en/function.gzencode.php


    <?php
    $data = implode("", file("bigfile.txt"));
    $gzdata = gzencode($data, 9);
    $fp = fopen("bigfile.txt.gz", "w");
    fwrite($fp, $gzdata);
    fclose($fp);
    ?> 
    Code (markup):
    do I have to do anything after saving the gzencoded data to a .xml.gz file??

    thanks
     
    TheAlchemist, Jul 23, 2007 IP
  6. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #6
    it's allways better to use sitamap creator problem.

    they are allways doing everythink for you:)
     
    trichnosis, Aug 17, 2007 IP