I'm new to web development. I've noticed that for some websites, by using firebug, I can see a lot of their internal information like their file structure, their file names and contents, which theme which they are using etc. I've read that by minifying CSS and JS, the files can be merged to a single file, so nobody can see the structure but how to make the internal code and other information hidden? Or is there no problem if user can access the code and other information?
Asked
Active
Viewed 111 times
0
-
1It usually doesn't make a difference if people see the structure or not. Minifying the code doesn't change the structure, but thats the part that is usually in need of protection and is suggested for production environments. – Blake A. Nichols Aug 13 '15 at 18:43
-
1You can't. And lets be honest, you are unlikely to be building anything so ground-breaking that you need to protect it if you are just starting out. Plus this has been asked _lots_ of times before [link](http://stackoverflow.com/questions/6597224/how-to-hide-html-source-disable-right-click-and-text-copy) [link](http://stackoverflow.com/questions/12543704/how-to-hide-my-source-code-so-to-not-be-copied) [link](http://stackoverflow.com/questions/25228476/how-to-hide-the-source-code-of-a-html-page) – Turnip Aug 13 '15 at 18:43
-
Any code executed client-side is visible. Any file accessed by the client is visible (URL/file structure). If your code must remain secret, it must be executed server-side. If you don't want to reveal your file structure, you can do URL rewriting (For example, look at the URL of this page. StackOverflow does not really have a folder called "questions" at the root of the site. Their server rewrites the URL that way). – blex Aug 13 '15 at 18:44