sikas
sikas

Reputation: 5523

.htaccess redirect certain files

I don`t know anything about .htaccess files except how to secure a folder or deny access.

I want to deny direct access to .js files (by typing the file name in url) on my server, say the files are stored in a folder named /js/ how can I use the .htaccess to do that?

Upvotes: 0

Views: 216

Answers (1)

kapa
kapa

Reputation: 78741

You cannot do that.

Actually there is no 'direct access' or 'indirect access'. The browser accesses the JS file the same way when you load it from a SCRIPT tag and when you try to load it separately (typing the file name in browser).

Upvotes: 1

Related Questions