Mar
24
Use htaccess to Fake Different File Extension
March 24, 2008 |
Sometimes you want to confuse potential hackers by faking your file extension, this may reduce automated hacker attacks. If you have Apache server and you are allowed to write .htaccess file, write the following code in your .htaccess file.
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.html$ /$1.php [NC,L]
In the example above, it will allow you to refer to your files as example.html instead of example.php
Similar Posts
- Remove File Extension Using htaccess
- Use htaccess with Site Maintenance Page
- Google Text Translation Using htaccess
- htaccess Explicitly Define Default Index File
- Apache htaccess Prevent Users from Uploading and Executing Files
- htaccess Deny Diractory Access During a Specific Time
- Block people from Certain URL Using htaccess
- Use htaccess to Deny Access Directory Listing
- htaccess Permanently redirect file or directory
- htaccess gzip for Faster Loading and Bandwidth Saving
- htaccess Remove the www From Domain URL
- htaccess Conditional Loop Redirect
- htaccess Require the www For Domain URL
- Use htaccess to Deny Access to hidden Files
- Create Custom Error Pages Using htaccess PHP
- Force Files Like PDF Download using htaccess
- Use htaccess for 404 Redirect
- Set Local Timezone Using htaccess
- htaccess Limit the Number of Concurrent Visitors to your Website
- Deny Access to inc Files Using htaccess
- Block IPs Using htaccess
- Useful mod_rewrite Resources


































