Is there any method to hide or to show an error page ,when a visitor try to access the js and css files from webpage source code?
1 Answer
No, because the browser needs to be able to load them for them to be usable. The request is exactly the same when the browser loads the JS/CSS file as a part of the page, and when the user tries to access the file directly, you cannot make any distinction at the server. Besides, the user can inspect the already loaded JS/CSS file in the browser without making any additional request to the resource.