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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.