Broadband
Dial-Up
Email
Hosting
Wireless
Security
Useful Tools
Quick Reference
Contact Us
Customer Portal
Site Search

Zen Internet Support Forum

Welcome to the Zen Internet community support forums.

Before posting we recommend you search our
extensive Knowledge Base or the forum archives
as an answer to your query may already be available.

Welcome to Zen Internet Support Forum Sign in | Join | Help
in
Forums Forum Rules

AddType in .htaccess

Last post 19-08-2008, 11:14 AM by daniel.gatley. 1 replies.
Sort Posts: Previous Next
  •  11-08-2008, 9:19 PM 31210

    AddType in .htaccess

    Hello,

    I am trying to force apache to parse files with a .xml extension as php script (I am generating xml files dynamically). While developing the website on my own machine I simply edited httpd.conf and added:

    AddType application/x-httpd-php .xml
    This worked perfectly fine, but when it came to uploading the website to the hosting server I obviously don't have direct access to the apache config file, so I added a .htaccess file to the directory with the .xml file I wish to parse as php. The .htaccess file consists of the following:
    AddType application/x-httpd-php .xml
    AddHandler application/x-httpd-php .xml
    This does not work. It is instead causing the browser to bring up a download window for the file (this also happens when trying to parse .htm/.html files as php scripts). I have tried every combination of the the two above statements, all have failed. I know Apache is checking .htaccess files as simple authentication can be set up quite easily. The conclusion I am forced to draw is that Apache is configured to ignore AddType and other such statements. I am hoping someone can shed some light on this, or even provide a solution, before I contact technical support. Thank you for your time. Charles Whatley
    Filed under: ,
  •  19-08-2008, 11:14 AM 31308 in reply to 31210

    Re: AddType in .htaccess

    Hi Charles,

    Did you contact support and resolve this issue?  If not I think you may simply need to specify the version of php you wish to use.  For example use:

    AddType application/x-httpd-php4 .xml
    AddHandler application/x-httpd-php4 .xml

    or

    AddType application/x-httpd-php5 .xml
    AddHandler application/x-httpd-php5 .xml

    However how well this works depends on which server your are currently hosted on.

View as RSS news feed in XML