htaccess Code Doesn't Work

The Scarlet Pimp

Supreme Member
Joined
Apr 2, 2008
Messages
1,419
Reaction score
4,460
I'm trying to make my .pl and .cgi scripts display as tho they were text files,
rather than executing. This is the code I'm using but it doesn't work. :confused:

Code:
RemoveType .cgi .pl
RemoveHandler .cgi .pl
AddType text/plain .cgi .pl
AddHandler text/plain .cgi .pl
 
Try removing the four lines you have and just using the following

Code:
<FilesMatch "\.(cgi|pl)$">
ForceType text/plain
SetHandler text/plain
</FilesMatch>

ForceType isn't supported by all hosts, which is why we back it up with a SetHandler. The FilesMatch applies this to files only with extensions .cgi or .pl
 
Back
Top