Poll

Was this tutorial helpful?

Yes
4 (57.1%)
No
3 (42.9%)

Total Members Voted: 5

Voting closed: February 21, 2003, 09:11:35 PM

Author Topic: How to request PHP pages as if they were .html files?  (Read 5816 times)

builder

  • Regular Member
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
    • MySQL PHP help
How to request PHP pages as if they were .html files?
« on: February 21, 2003, 09:11:35 PM »
Suppose you would like your PHP pages to masquerade as .html files. How would you accomplish that?

If you are running PHP on the Apache web server platform, you can take advantage of issuing server directives from an .htaccess file in the root web folder or in any sub folder.

Include in you .htaccess file:

Code: [Select]
AddType application/x-httpd-php .html
If you are running PHP through a 'script wrapper' the code would look something like this:

Code: [Select]
Action application/x-myhost-sphp4 /cgi-bin/php-cgiwrap/myaccountname/php4.cgi
AddType application/x-myhost-sphp4 .php .html


You need to consult your individual hosting provider for details on how to invoke the wrapper, if any.
PHPHELP COMMUNITY HELPER Please contact me only by PM instead of e-mail.
Founder/Creator of phphelp.com

evilcoder

  • New Member
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
(No subject)
« Reply #1 on: February 22, 2003, 12:22:28 AM »
just adding to this.

Using htacess is also great for creating your own extensions. for example on my site i use .dnx to parse as .php files.

I've created 3 variations:

.dnx --> Main files with design work
.idnx --> Includes with just code
.cdnx --> Class files with functions in them.
I will die before YOU GET MY BARBIE!