FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.
How to disable ability to view/download files with certain extensions?
Posted on 01 January 2004 07:42 AM
Question
I just found out that your web server allows users to view/download perl scripts with the extension .pm (eg. myscript.pm). This is very risky for those of us who use scripts with such an extension for commercial purpose. Can you disable the ability to view/download such files by visitors?


Answer
This is a control that would need to be done locally by you, as our other Site Owners may be using the '.pm' extension for more generic things and we do not want to deny their usage without cause.

To accomplish this, you would simply need to:

1) Create an .htaccess file in your www directory
2) Insert the lines:
<FilesMatch "\.pm$">
Order deny,allow
deny from all
</FilesMatch>