0

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.

4
  • 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, 2013 at 2:05
  • it should be interpreted as PHP and shown as an HTML file May 18, 2013 at 2:37
  • This is really something you should be discussing with your hosting provider...
    – voretaq7
    Jun 6, 2013 at 20:17
  • @voretaq7♦ no. i think some of you may know how to do the trick Jun 12, 2013 at 19:27

1 Answer 1

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.

2
  • Or possibly in your .htaccess if you do not have write permission to httpd.conf May 18, 2013 at 9:43
  • @DavidHoude Most providers (and most sane server administrators) don't allow directives like AddType in .htaccess files...
    – voretaq7
    Jun 6, 2013 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .