Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    58

    Default SuPHP Question - making .html files behave as .php files

    I recently added SuPHP to my server and a lot of my old html pages I had set to act as php are no longer working because of the no php in .htaccess bit.

    I've been looking all over for a solution to this. Is there something I can replace the htaccess line I had with something in php.ini?

    My old htacess line was

    Code:
    AddType application/x-httpd-php .html
    Here's just some similar htacess commands for people searching for help with this same problem.

    AddType application/x-httpd-php .html
    AddType application/x-httpd-php .html .htm .php
    AddHandler x-httpd-php .html .htm .cgi .php
    AddType x-mapp-php4 .html .htm .php
    AddHandler server-parsed .html .htm .php
    AddType application/x-httpd-php4 .htm .html .php
    AddHandler application/x-httpd-php5 .html .htm .php
    Last edited by Doug E; 03-29-2010 at 08:58 PM.

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    I strongly recommend that you DO NOT parse .html files as PHP scripts.

    There is ways you can set this up to work even under SuPHP but it is a very bad idea for a lot of technical reasons and will also substantially increase loads to your server and is generally a very bad idea.

    It is much smarter and wiser to properly rename all your .html files to .php and then setup a redirect mapping the original .html URLs to the .php filenames and by doing that, there is no need to update the links in all your files which I am sure is what you are trying to avoid by the question.

    Doing things this way, you do not causing unnecessary loads to your server or the many other issues that can be caused by doing what you were asking about but still effectively be able to do the same thing.

  3. #3
    Member handsonhosting's Avatar
    Join Date
    Feb 2002
    Location
    Omaha, NE
    Posts
    150
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    With SuPHP you'll want to use the AddHandler option in your .htaccess file instead of the AddType;

    AddHandler application/x-httpd-php5 .php .html .htm

  4. #4
    Member equens's Avatar
    Join Date
    Feb 2002
    Posts
    256

    Default Strange error

    This worked for me but only when accessing to the entire url like http://www.mysite.com/doc.html

    But when I go to http://mysite.com/doc.html Google Chrome asks to download a php file instead of opening the page.

Similar Threads & Tags
Similar threads

  1. Replies: 13
    Last Post: 02-17-2012, 05:25 PM
  2. Cannot Parse php within .html files!
    By smartads in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 03-19-2009, 08:24 PM
  3. HTML files via PHP engine?
    By doni49 in forum New User Questions
    Replies: 1
    Last Post: 02-25-2007, 10:37 AM
  4. .php includes in .html files?
    By katz_global in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 12-06-2004, 07:03 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube