Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Using PHP Program With HTML Extensions (http://www.greenguysboard.com/board/showthread.php?t=35328)

Doug E 2006-10-16 06:23 PM

Using PHP Program With HTML Extensions
 
I just downloaded and installed a hardlink script that is PHP based. The problem Im having now is all my sites sit on pages with the extensions .html and .shtml

Is there anyway to run a software program thats supposed to go with .php with my .html and .shtml ?

The program is Links Organizer btw.

dareutwo 2006-10-16 07:34 PM

Try using this in your htaccess

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

Note - this will make php work but ALL ssi calls will Not. It's an either or sort of thing.

Doug E 2006-10-18 03:12 AM

ahh so I can use my php script on an html file but not my tgp script ?

also, for .shtml files do i need to use a 'AddType application/x-httpd-php .html .htm' line in my .htaccess as well ?

cd34 2006-10-18 11:13 AM

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

Add the .shtml if you want to parse .shtml for php.

You actually can parse for both in Apache2 by setting up an INCLUDES filter on the content.

Make sure pages are already parsed, then do something like:

AddOutputFilterbyType INCLUDES text/html

maybe..... :)

Doug E 2006-10-19 01:46 AM

Quote:

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

Add the .shtml if you want to parse .shtml for php.

You actually can parse for both in Apache2 by setting up an INCLUDES filter on the content.

Make sure pages are already parsed, then do something like:

AddOutputFilterbyType INCLUDES text/html

maybe.....
hmmm. my tgp script, the template page is in a folder like mysite.com/vanilla/sitetemplates/main.shtml

that parses mysite.com/main.shtml

now if i drop an .htaccess file into mysite.com folder to php parse .shtml its going to parse both main.shtml files. is their somehow i can make this .htaccess php command just parse the mysite.com/main.shtml file? so that it doesnt affect the vanilla/sitetemplates/main.shtml file.

this is getting complicated for my noob ass. i might just have to find some inferior software thats non php babsed :)

oast 2006-10-19 08:29 AM

In the 'sitetemplates' directory add another .htaccess file with the one line

RemoveType .htm .html .shtml

That will undo what the AddType did in your root, in effect setting the extensions back to their defaults.

==Extra Note==
You could/should put it in any directories below root in which you have .htm(l) files to prevent the server wasting resources as it tries to parse static .htm(l) files.

Doug E 2006-10-23 03:12 AM

Quote:

In the 'sitetemplates' directory add another .htaccess file with the one line

RemoveType .htm .html .shtml

That will undo what the AddType did in your root, in effect setting the extensions back to their defaults.

==Extra Note==
You could/should put it in any directories below root in which you have .htm(l) files to prevent the server wasting resources as it tries to parse static .htm(l) files.
will do, thanks very much for the help! :)


All times are GMT -4. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc