apache2 processing php files with html extensions

This is a discussion on apache2 processing php files with html extensions within the PHP Language forums, part of the PHP Programming Forums category; Hello, Apache2 on Unix, with php support compiled in as a dso. Currently to get support on a page the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2005
dave
 
Posts: n/a
Default apache2 processing php files with html extensions

Hello,
Apache2 on Unix, with php support compiled in as a dso. Currently to get
support on a page the page has to be renamed with a .php extension. I don't
want to do this, i'd have to rename several dozen pages plus change all the
links within a page. How would i make apache2 handle php processing for all
pages that have either .php, .htm, or .html extensions?
Thanks.
Dave.


Reply With Quote
  #2 (permalink)  
Old 02-16-2005
sharma
 
Posts: n/a
Default Re: apache2 processing php files with html extensions

Add .html to this php directive in php.ini

1)search for this in php.ini
AddType application/x-httpd-php

2) .html at the end of the line like this

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

if you want htm page to run add .htm ..
AddType application/x-httpd-php .php .html .htm

3)restart Apache...

If you are not having access to php.ini.. put it line 2 in .htacess
file and place it in your webroot...

Hope this helps..

Thanks,
sharma

Reply With Quote
  #3 (permalink)  
Old 02-16-2005
sharma
 
Posts: n/a
Default Re: apache2 processing php files with html extensions

Hey sorry,

Its not in php.ini...

Its in Apache's configration file, httpd.conf, you need an AddType
directive that matches scripst ending in .php with
application/x-httpd-php.


1)search for this in php.ini
AddType application/x-httpd-php

2) .html at the end of the line like this

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

if you want htm page to run add .htm ..
AddType application/x-httpd-php .php .html .htm

3)restart Apache...

If you are not having access to php.ini.. put it line 2 in .htacess
file and place it in your webroot...

Hope this helps..

Thanks,
sharma

Reply With Quote
  #4 (permalink)  
Old 02-16-2005
dave
 
Posts: n/a
Default Re: apache2 processing php files with html extensions

Hello,
Thanks a lot that did it.
Dave.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0