Hide my files from user
Hi, I'm new to cpanel and i want to hide my files from user.
For example, now if someone enter ib the URL "www.mydomain/folder/file.js"
He can view my code. How can I disable this?
I already have a redirect on the folder, and disabled index on the folder. Still same thing
-
Javascript is a client-side programming language, therefore it works on the client's machine, so you can't actually hide anything from the client. 0 -
Javascript is a client-side programming language, therefore it works on the client's machine, so you can't actually hide anything from the client.
But i want to hide it with the server, in this moment everyone can just view my code abd copy it. There is no solution?0 -
If you are serving the JS/JavaScript to a client, there is no way to "hide" it; it is a client side scripting language. If you don't need to serve it, you can move it outside of public_html 0 -
If you don't need to serve it, you can move it outside of public_html
I think that this is my answer. If i will move my folder i will need to re direct my files tovthe path? From To I will check this out as soon as I get home and let you know if that did the job. Thank you for your answer!0 -
I will check this out as soon as I get home and let you know if that did the job.
I'm happy to see the solution offered was helpful. Feel free to update this thread with the outcome when you have the time. Thank you.0 -
Unfortunately this is not what i expected, my js file should be out of reach for the user, but the html is using it. If I'm moving my file out of the public_html im getting a "forbidden" page when the index.html is trying to reach it's code. How can i hide it from the user? It is not making any sense that any user will be able to view my js code. 0 -
Hello, Since it is javascript it is a browser-interpreted file which means that the user will have to be able to read it since the browser has to be able to read it. There is nothing you can do to prevent this from happening. 0 -
Hello, Since it is javascript it is a browser-interpreted file which means that the user will have to be able to read it since the browser has to be able to read it. There is nothing you can do to prevent this from happening.
Yeh.. I just realized how low my coding was. I didn't implemented a server side. My solution is to install node.js on my server and use an api to access my db. Thank you all for your answers0 -
Hello :) I'm happy to see you were able to find a suitable solution. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
9 comments