In my popular post about hiding your Word Press folder, a reader asked:
can you teach me or show me how to do that, any help highly appreciated, And im so sorry if my english not good.
This question was complicated enough where I thought a new post might make sense.
For clarification, I believe he is asking if it’s possible to put one thing in the source and another that the browser sees. This is impossible. Anything that the browser can see, the user can see. There is no way to “show” something different in the source of an HTML file versus what the browser sees (except through obfuscation); however, you can forward things along behind the scenes. You want to create an htaccess rule that will redirect your requests.
RewriteRule /path/to/thejsfileyouwanttoshow\.js /path/to/real/js/file.js [L]
Let me reiterate that you *cannot* hide the content of the JS file. However, you *can* hide the true folder structure of the web server. If you desire to hide your JS contents, the better solution is a JS minifier.
I hope that answers your question.