How to get .html pages to compile PHP code
Moderator: General Moderators
How to get .html pages to compile PHP code
Hello,
I am a novice to PHP and am working with someone who wants to have all of the pages on their site with .html extensions, but wants those pages to be able to compile PHP.
Is this possible? If so, how, and is it easy?
Thanks,
Dan
P.S. It's a standard Unix webhost using PHP 4.0
I am a novice to PHP and am working with someone who wants to have all of the pages on their site with .html extensions, but wants those pages to be able to compile PHP.
Is this possible? If so, how, and is it easy?
Thanks,
Dan
P.S. It's a standard Unix webhost using PHP 4.0
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
quite simple in most servers, you simply map the file extension to be used by phpon Apache servers...
Code: Select all
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
</IfModule>I'm assuming you're using Apache here. If you have access to the httpd.conf file, there's a section that looks like this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Just add this line underneath:
AddType application/x-httpd-php .html
The trouble is, if its a hosting company, you probably won't have access to the httpd.conf file. You could ask your hosting company to do it for you, but I doubt they will, because that'll affect other users too.
Edit: Damn, beaten to it.
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Just add this line underneath:
AddType application/x-httpd-php .html
The trouble is, if its a hosting company, you probably won't have access to the httpd.conf file. You could ask your hosting company to do it for you, but I doubt they will, because that'll affect other users too.
Edit: Damn, beaten to it.
You were two seconds ahead of me! Diabolical is the word.feyd wrote:mwhahahahahha it's all apart of my diabolical plan..deltawing wrote:Edit: Damn, beaten to it.
I'm trying to think of some sort of good programming practice pun on that. Ideas, anyone?
And no, sorry. I can't think that there is. You could try sending your hosting company an email asking them if it would be possible for them to set that up for you. It all depends on how they have set up the shared server, and I don't really know how that stuff works.
Last edited by deltawing on Fri Sep 09, 2005 6:27 pm, edited 1 time in total.