Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Deny directly access to javascript files

$
0
0

Hi all.

I'd like to deny directly access to my js files, but I'm in trouble.

Imagine I have a web site www.example.com an it uses js files, so, someone tries to accesswww.example.com/scripts/script.js and it opens the source code of my script on the browser. 

I'd like to deny this type of access.

I've already tried to put a web.config in the script folder as follows:

<configuration>
   
<system.webServer>
     
<security>
         
<authorization>
           
<removeusers="*"roles=""verbs=""/>
           
<addaccessType="Allow"users=""roles="Administrators"/>
         
</authorization>
     
</security>
   
</system.webServer>
</configuration>

It works in part, it denies access to my js file, but my web application gets denied, too and stops work.

I need just block directly access, could you give me a help?

thanks,

Daniel Costa


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>