Some
web hosts that support custom Apache
handlers provide an easy to use
control panel to help create and
manage custom Apache handlers.
For those web hosts that do not have
an easy method to create and manage
custom Apache handlers, you still may be
able to setup custom Apache handlers
using a .htaccess file.
Example:
Lets say you want to run PHP code in
a .html file.
Step 1:
Create a plain text file using a
text editor such as Windows Notepad.
Step 2:
Add the following text...
AddHandler application/x-httpd-php
.html |
Step 3:
Save the file as a plain text
file. Name the file ".htaccess"
Step 4:
Upload the .htaccess file in
ASCII mode to your web space using
an FTP application.
Step 5:
Try it out. Upload a php script
to your web space (script.php).
Rename the php script to use a .html
extension (script.html). Go to the
script in a web browser. |