Jump to content

[SOLVED] Parsing php in html


benji87

Recommended Posts

Hi all. I recently had to change servers from linux to windows as i was having a load of problems with php and the easiest way to fix it seemed to be changing over. Now ive done this is cant seem to parse php in html files anymore.. ive still used the same .htaccess file but it just doesnt seem to work.

 

Here is my htaccess code

 

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

 

Can someone help? Thanks

Link to comment
https://forums.phpfreaks.com/topic/81160-solved-parsing-php-in-html/
Share on other sites

I can shed a little light on this...

 

From my own experience, and as far as I'm aware, Windows servers, or when using IIS, the htaccess files are more or less, useless. Windows/IIS doesn't recognize or use htaccess files.

 

I don't know if you have a dedicated, or are on a shared host, etc.. but if I recall, you'll need either a application extension added (extension, executable path, verbs), so that iis knows to use php for .html and .htm.

 

Also if I recall, you may need to change the .html / .htm mimetypes on iis from "text/html" to "application/x-httpd-php" I believe. (without quotes of course)

 

Depending how the server your on is setup, you may only need the mimetype, or may only need to change the application extension, or perhaps both.

 

Hope this helps. :)

 

-alt

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.