View Full Version : Using Includes in pages with non .php extentions


Waddle
02-27-2005, 04:01 PM
Hi All,

If I have a page that has an .html extention, how can I get php-based server side includes to work in that page?

ResaleBroker
02-27-2005, 04:56 PM
If you're on an Apache Server you can have the server parse PHP code in .html files by adding this code to your .htaccess file:

AddType application/x-httpd-php .php .htm .html

Waddle
02-27-2005, 06:14 PM
[QUOTE=ResaleBroker]If you're on an Apache Server you can have the server parse PHP code in .html files by adding this code to your .htaccess file:

AddType application/x-httpd-php .php .htm .html[/QUOTE]


Does the .htaccess file need to be in the same directory that the files are in? or does it just go in the root directory?

Thanks

ResaleBroker
02-27-2005, 06:47 PM
[QUOTE=Waddle]Does the .htaccess file need to be in the same directory that the files are in? or does it just go in the root directory?[/QUOTE]For that particular code you could include it in the .htaccess file located in the root directory.

Waddle
03-02-2005, 07:41 PM
[QUOTE=ResaleBroker]For that particular code you could include it in the .htaccess file located in the root directory.[/QUOTE]


Thanks for your help. I really appreciate it.

ResaleBroker
03-02-2005, 08:28 PM
Happy to be of help.