Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I get apache to send Content-Type text/plain for php files?

I can accomplish this in php using

header('Content-Type: text/plain');

I tried adding this to my vhost.conf (I am using Plesk) and reloading and restarting apache

<Directory />
    AddType text/plain php
</Directory>

It does not seem to help.

I also tried setting the AddType in .htaccess, but still no luck.

share|improve this question
add comment

1 Answer

Your AddType is probably overriden somewhere else in your config. Use ForceType instead.

<FilesMatch "\.php$">
  ForceType text/plain
</FilesMatch>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.