Hi all, I've got this small PHP script that will generate a XML output from a MySQL. When I call the 'make.php' file it does show a nice XML output. How do I get this script to listen to a .XML request instead of a .PHP one? Do I need to add something in my .htaccess file? example: mydomain.tld/make.php does work and generate a xml output from my MySQL on screen. mydomain.tld/make.xml does not work (as there is no .xml file) System I'm trying this on is CentOS using PHP 4.3.10
Hi, I'm afraid I've not done this on CentOS using PHP 4.3.10, but on SuSE with Apache 2 you'd just need to add the following line into Apaches PHP config file (/etc/apache2/conf.d/php5.conf): AddType application/x-httpd-php .xml Apache will then just treat all files with the .xml extention as a PHP script. Hope this helps... Neil
Hello Neil, I do have a AddType application/x-httpd-php .php in my php.ini file. Can I (if it works) just add .xml after the .php, or do I need to make a new linke? AddType application/x-httpd-php .php .xml or a new line with only AddType application/x-httpd-php .xml I guess I will also need to restart Apache after this?
I'd rather use a .htaccess entry, otherwise every xml is being parsed as PHP... The .htaccess could look like this Code: <Files *xml> ForceType application/x-httpd-php </Files>
Neil, you're solution definitively works... I'm not 100% sure about how to specify the files... I think *xml is ok but as said, not 100% sure ^^