Results 1 to 8 of 8
  1. #1
    Web Ho - Design B!tch ~Michelle's Avatar
    Join Date
    January 18th, 2005
    Location
    Michigan
    Posts
    2,040
    Is this the proper code to add to my .htacess file to make php code work on my .html pages?

    AddHandler cgi-script .html
    ~Michelle
    "All I ask is a chance to prove that money can't make me happy."
    "Work to become, not to acquire." -- Confucius

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Location
    UK
    Posts
    273
    This is what I have got on one of my sites
    in a .htaccess file
    which allows me to put PHP codes into .htm pages
    to read a datafeed file jusrt the same as if the file was a .php

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

    Was a while back I worked it out, so not sure where I got the info from originally.

  3. #3
    Intergalactic Trader IGshop's Avatar
    Join Date
    January 18th, 2005
    Posts
    87
    So, in other words, by using that code I can put php in an html file and it'll work the same as if it were in a .php file?

    Thanks,

    Jim

  4. #4
    Web Ho - Design B!tch ~Michelle's Avatar
    Join Date
    January 18th, 2005
    Location
    Michigan
    Posts
    2,040
    Thank you websmith!
    ~Michelle
    "All I ask is a chance to prove that money can't make me happy."
    "Work to become, not to acquire." -- Confucius

  5. #5
    Newbie
    Join Date
    January 18th, 2005
    Posts
    46
    >>>So, in other words, by using that code I can put php in an html file and it'll work the same as if it were in a .php file?<<<

    Correct... just add a .htaccess file in the folder you want .html files to be parsed as PHP, and voila (be careful if you already have a .htaccess file in there, they are normally not visable via FTP).

    Cheers

  6. #6
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    I have a quandary now - I've already added this

    AddType text/x-server-parsed-html .htm
    AddType text/x-server-parsed-html .html

    to my htacess file to allow for SSIs to be added into the existing old html files...if I add

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

    as well because I want to now add php to the site, it seems to turn off the SSIs on my pages...is there a way around it? Can I call the php script from a SSI?

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  7. #7
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I think you could use the equivalent php call and that would work. I'm not sure offhand what it is.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  8. #8
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    So if I call in

    <!--#include virtual="/example.php" -->

    it will work?

    I'll give it a go Gordon.

    Thanks,
    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  9. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Php - Html
    By betherg in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: January 7th, 2013, 10:59 AM
  2. Using PHP (or JS) on .htm or .html pages
    By webworker in forum PopShops
    Replies: 42
    Last Post: September 18th, 2011, 12:09 PM
  3. .PHP pages versus .HTML pages?
    By sixeden in forum Search Engine Optimization
    Replies: 7
    Last Post: January 20th, 2007, 05:24 PM
  4. Making php pages search engine friendly
    By sewgifts in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: September 4th, 2006, 01:28 AM
  5. PHP on .HTML - .SHTML Pages
    By AddHandler in forum Programming / Datafeeds / Tools
    Replies: 11
    Last Post: April 16th, 2005, 08:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •