Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I pay for a webhost service running a LAMP combo and I was wondering if I could have a custom extension for my documents such as:

instead of:

It works on my local XAMPP computer (without modifying anything) and I can name my files whatever I want, but I can't on my paid webhost; it just shows me the HTML as plain text.

share|improve this question
To clarify: Do you want your custom.extension file in the example to be interpreted by PHP as it would custom.php, and ultimately be delivered to the user as HTML? – May 18 '13 at 2:05
it should be interpreted as PHP and shown as an HTML file – Oily May 18 '13 at 2:37
This is really something you should be discussing with your hosting provider... – voretaq7 Jun 6 '13 at 20:17
@voretaq7♦ no. i think some of you may know how to do the trick – Oily Jun 12 '13 at 19:27

You need to setup Apache for that. Add a line like the following to your httpd.conf:

AddType application/x-httpd-php .extension

and it should work.

share|improve this answer
Or possibly in your .htaccess if you do not have write permission to httpd.conf – David Houde May 18 '13 at 9:43
@DavidHoude Most providers (and most sane server administrators) don't allow directives like AddType in .htaccess files... – voretaq7 Jun 6 '13 at 20:16

Your Answer


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.