Arbusto
Arbusto

Reputation: 47

.htaccess to block specific file

I been searching and couldn't find this answer, usually they all ask how to block viewing the file from outside the domain.

I have a website where I don't have access to the remove a script by hand or Javascript since it executes before I can do it, but I do have access to the folder, so I was thinking if I can add an .htaccess blocking that specific JavaScript file (not all the .js files, only one which is prototype).

Is there any code to do to that?

Thank you in advance.

Upvotes: 1

Views: 3175

Answers (1)

Joe
Joe

Reputation: 4917

Yes there is! Put this in your .htaccess file:

<Files "example.js">
Order Allow,Deny
Deny from all
</Files>

Upvotes: 3

Related Questions