|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have modified my existing webpage, and under going testing i am having problems with pages with the extension .htm. These pages have php embedded in them, but they display as a htm and do not run the php code.
Does anybody know what i am doing wrong? Is it something to do with the htaccess file, currently i do not have one in the main directory (do i need one)? Cheers, Andrew
__________________
Discount shopping vouchers |
|
|||
|
The normal default configuration for web servers is that only files ending in .php will be passed to PHP for processing.
You can try adding the following to your .htaccess file to cause .htm and .html files to be treated as PHP: Code:
AddType application/x-httpd-php .htm .html |
|
||||
|
Note that making this change may not be desirable if most of your pages are pure html. If you add an entry to the htaccess as suggested, all html files will be parsed for php, which could put an unnecessary load on your server. Also, if you use a doctype tag, your normal pages could break. (The <? that opens the doctype definition is a php shortcut tag.) Some shared hosts also do not allow extensions to be changed in this way. If this is the only php page and you don't want the php extension, I would suggest using mod rewrite if that is an option on your server.
__________________
The best way to learn anything, is to question everything. |
|
|||
|
Thank you all for your help. I have opted for the addition of a .htacess file, as all my pages are php and it would not affect the load on the server.
__________________
Discount shopping vouchers |
|
||||
|
Depending on what way your web server is configured you may have to add the following line to .htaccess instead of the one mentioned above (this is what I had to do to allow .htm files to be parsed as .php files):-
AddHandler php-script .htm It worked perfectly for me with no messing around having to redirect pages etc..
__________________
Irish Wallpaper/Photos/Desktop Backgrounds|PPC NI| Google Advertising Professional |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SEO Extension for Firefox | flood6 | Search Engine Optimization Forum | 56 | 02-09-2006 11:03 AM |
| Firefox Gets SEO Extension | jmiller | Search Engine Optimization Forum | 1 | 10-31-2005 12:33 PM |
| Firefox extension DB problems | AjiNIMC | Web Programming Discussion Forum | 0 | 06-17-2005 02:02 PM |
| The next most popluar extension after .com | kikkertm | Domain Discussion Forum | 9 | 05-06-2004 09:33 PM |
| Do you know about file extension FLM | kiumars | Flash Discussion Forum | 7 | 04-10-2004 06:45 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2010 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |