Hi, I have a script below which has been working fine however i have just moved server and rather than showing the page, it now just downloads it. Any ideas? The page is called sitempa.xml and the script is below. My thoughts is that the new server does not support something but not sure what to ask them to activate. <?php // include init which contains all the includes. include('init.php'); function stripres($value){ $value = strtr($value, "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ. ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz--"); $value = ereg_replace('[^a-zA-Z0-9_-]', '', $value); return $value; } header('Content-Type: application/xml'); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <?php $result = mysql_query("SELECT * FROM `pages` WHERE memberid = '$resv[id]' AND page_link = ''"); while ($row = mysql_fetch_assoc($result)) { ?> <url> <?php if ($row['page_name'] == 'Home Page'){ ?> <loc>http://<?php print $_SERVER['HTTP_HOST']; ?></loc> <?php }else{ ?> <loc>http://<?php print $_SERVER['HTTP_HOST']."/".$row['page_url'].".html"; ?></loc> <?php } ?> <lastmod><?php print $row['sdate']; ?></lastmod> <changefreq>daily</changefreq> <priority>0.5</priority> </url> <?php } ?> </urlset> Code (markup):
I might have the same situation last year with .webm files (HTML5 videos); any browsers had refused to stream them and offered instead popups for downloading. What I did to resolve it is by entering server Control-Panel and go for MIME-Type thumb/ icon. There I saw that this kind / type of file hasn't been registered. I just add this type and voila... no more popups. So maybe you should see your Control-Panel > Mime-Type page too, and check whether "application/xml" hasn't been enlisted there. Hendra
Replace: header('Content-Type: application/xml'); Code (markup): With: error_reporting(-1); ini_set('display_errors', 'on'); Code (markup): And see if there are any errors/warnings.
Can you try renaming the file to "sitemap.php" instead of "sitemap.xml"? Most place, including Google Webmaster Tools, accept both PHP and XML sitemaps. I also use a similar script on my website and the file needs to be named sitemap.php to work. If this does not solve the problem. Here are a few other common solutions to that type of problem: Make sure your httpd.conf file contains the following: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Code (markup): Also make sure the php module is loaded: LoadModule php5_module libexec/apache2/libphp5.so Code (markup): It might help if you post the contents of your httpd.conf file.