Solved

How to get PHP4 module to recognize files ending in .html?

Posted on 2003-12-04
4
197 Views
Last Modified: 2008-07-03
My ISP offers PHP 3.0.18 as CGI and PHP 4.x as a module. They told me that if I want to upgrade to 4.x, to just delete the AddType line from my .htaccess file. Here's my current .htaccess file:

IndexIgnore *
DirectoryIndex index.html index.php index.php3
AddType application/x-httpd-php3 .html .php .php3

I deleted the line, and sure enough when I opened a test file containing <? phpinfo(); ?>, it was version 4.

My problem is that all my PHP files end in the .html suffix, not .php, and I want to keep it that way, since I don't want to change all the names and file references, and I just like having my users see normal looking file names. I tried changing the AddType declaration to php4, and it didn't work.

My question: What do I put in my .htaccess file that will allow me to upgrade to PHP 4 module, but still use .html as the file suffix for PHP files?
0
Comment
Question by:mschrimsher
4 Comments
 
LVL 6

Accepted Solution

by:
aolXFT earned 250 total points
ID: 9875926
AddType application/x-httpd-php .php .html

Should do the trick.
0
 

Author Comment

by:mschrimsher
ID: 9878543
Thanks! It worked like a charm. I added

          AddType application/x-httpd-php3 .php3

also, and I can use both versions!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now