Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

www.mysite.com/custom.extension

instead of:

www.mysite.com/custom.php

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.

Any help? Thanks.

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? –  s.co.tt 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
add comment

1 Answer 1

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
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.