1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Mod Rewrite Help: How to change Sitemap.php to sitemap.xml?

Discussion in 'Apache' started by YIAM, Jan 21, 2007.

  1. #1
    I have written a script that will creat a sitemap of my site. I need to change file name sitemap.php to sitemap.xml. I have tried several ways to chage it but didn't work. Any help??

    Edit:
    I have used the following line and it changes the file name but showing as text file not as an xml file. Though the source of file shows what I want to see in sitemap.xml. Still looking for help ???

    SEMrush
     
    YIAM, Jan 21, 2007 IP
    SEMrush
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    I think that your RewriteRule is Ok, but not the content type set on your php file.
    You can use "Content-type: text/xml" or "Content-type: application/rss+xml"

    Take a look at this page http://www.petefreitag.com/item/381.cfm for a solution with both.
     
    ajsa52, Jan 22, 2007 IP
  3. snvc

    snvc Peon

    Messages:
    194
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try this...
     
    snvc, Aug 13, 2008 IP
  4. Paintball Guns

    Paintball Guns Active Member

    Messages:
    173
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I'm trying to do something like this. Would you care to share the contents of your PHP file and your .HTACCESS file?
     
    Paintball Guns, Nov 13, 2008 IP