Is it possible to password-protect a subdirectory like domain.com/js/ or domain.com/php_scripts/ so that users can't access these, but the webpages on the site still can?
For example, when a user logs in, or sends a message to another user, jquery on these webpages call scripts in the 'php_scripts' folder to execute these actions.
I'd like to prevent access to folders like 'php_scripts' from people (and bots) externally but I haven't found a way that doesn't also cause issues with the actual pages on the site being able to access the files in subdirectories like this as well.
The site uses Apache and WHM/cPanel.