Hiding PHP file extension

July 27, 2009 | In: htaccess, php

Do you want to hide your web site’s server script identity ? If you don’t want to reveal the programming language ( server side script ) of your website to visitors of website so that any hacker or spammer will not be able to intrude or inject any code in your website.

Here is a small technique for you, you can use .html or .asp file to work as a php file i.e. use .asp or .html extension instead of .php. You just need to create a .htaccess file and put the following code in the .htaccess file. Remember that the .htaccess file should be placed in the root folder of your website.

# Make PHP code look like asp or perl code
AddType application/x-httpd-php .asp .pl

if you place the the above code in the .htaccess file then you can use contact.asp as the name of the file. Now a visitor thought that it is a ASP file but this file contains the codes of PHP.

You can put the following code in .htaccess file to work .htm or .html file as PHP file.

# Make all PHP code look like HTML
AddType application/x-httpd-php .htm .html

3M0-600 certification exams are very important for IT professional for getting more updated skills. 4H0-028, Hyperion Certified Professional – System 9 Planning 4.1 exams are very significant exams for becoming more professionals in the field of technology. 50-686, certification exams are very assistive to give full training to IT professionals. 640-802 is also known as CCNA, very significant exams for Cisco networking administrators. 640-863 certification exams provide very exact solutions of Cisco networking in the most effective manner. 3Com Certified IP Telephony NBX Expert Final Exam V3.0 is also known as 3M0-701 which provides authentic knowledge for operating IP telephony networks. 310-203, Sun Certified System Administrator for the Solaris 10 Operating System is designed to improve the professional talents of the individuals for operating system efficiently.