I have a directory on my website specifically for javascript files, I want these javascript files to be hidden, so if I type the url to it it says Forbidden or disallows access, but my front-end website files can still access them to execute them when needed. Is there a way to do this through a FTP client?
Cheers,
Dan
You can’t do this trough a ftp client. It is the task of your webserver to forbid access to certain files.
If you change permission, the webserver won’t have access to them anymore, so this is not the way to go.
You must configure your webserver to restrict the access. If you’re using Apache, you can use an
.htaccessfile. There’s different ways of doing this, many depends on the way the webserver is configured.The easiest is to put an
.htaccessfile in your Scripts folder which contain only this none line :However, like peeter said, there’s a good chance this will break your site, since the browser must access theses files, so you can’t restrict access.