0

What is the most defensive way of blocking someone from viewing source code? I know people can still get to it -- but hopefully those of a lesser tech people cannot get to it?

It's .htaccess -- right?

test
  • 17,706
  • 64
  • 171
  • 244

2 Answers2

2

I don't think it's .htaccess, you can use that to block access to your files all together.

  • A very simple, maybe not so very effective way is to add a lot of blank lines at the top of your html file.
  • Further you can obfuscate javascript (1) or minify (2) it (here to reverse (3))
  • Blocking the right mouse click (4) with javascript
  • If it's php source code you want to protect while still be able to distribute your source, you can try something like Zend Guard (5)

1: How can I obfuscate (protect) JavaScript?

2: http://www.minifyjavascript.com/

3: Tool to reverse Javascript minify?

4: How to disable mouse right click on a web page?

5: http://www.zend.com/en/products/guard/

Community
  • 1
  • 1
Rutger
  • 96
  • 3
-3

If you can't use .htaccess, it is pointless. Anyone can just disable javascript in their browser and do it anyway.

o-90
  • 17,045
  • 10
  • 39
  • 63
Janus
  • 1