Reputation: 91
I have a contact form on a site with an .html extension that needs to be run as .php. I know you can use mod rewrite to treat all .html files as .php, but can you do it for just one file?
TIA...
Steve
Upvotes: 0
Views: 206
Reputation: 7128
http://www.php.net/manual/en/security.hiding.php
If you want to do this for only one file , you have to set a unique extension (like .xyz) . If you choose .html all .html files executes as a PHP file.
Upvotes: 0
Reputation: 669
<Files bar.html>
SetHandler php-script
</Files>
or something similar in either a .htaccess or your apache config.
Upvotes: 2
Reputation: 10859
If you use Apache, try to add this to your .htaccess:
AddType application/x-httpd-php .htm .html
AddHandler x-httpd-php5 .htm .html
(courtesy kavoir.com)
Upvotes: 1