We get this question a lot and the truth is there is no 100% foolproof way unless you make your page in PHP and use something like Zend, SourceGuardian, or IonCube which costs money and can be very tricky. In most cases, this is not realistic to do and not necessary. We recommend not worrying about it.
After all, imitation is the sincerest form of flattery.
Really, though, 99.9999% of people are not out to steal your website and most new sites are just ideas of other sites compiled together with a new vision. With that said, if you’re still worried about someone using your goods, then here are some tricks to get you started on how to block the downloading of your web pages.
1. Stopping someone from seeing your site tree or file listing. With WebHost.pro there is a tool for this in your cPanel or you can simply add this code into your .htaccess file:
Options -Indexes
or it might be:
Options All -Indexes
2. Pay for it, there is a service that will do some crazy encoding, disable your right-click, and stop view source on the site. http://www.htmlguard.com
3. Stop image and video hot linking with .htaccess. Again, if you are with WebHost.pro there is a tool to just switch this on in your cPanel or you can add this code directly into your .htaccess file in the public_html folder.
- RewriteBase /
- RewriteCond %{HTTP_REFERER} !^$
- RewriteCond %{HTTP_REFERER} !^http://(www.)?your-main-domain.com/.*$ [NC]
- RewriteRule .(gif|jpg|swf|flv|png)$ /feed/ [R=302,L]
4. Block Evil Robots, Site Rippers, and Offline Browsers. There are better lists but this one will get you started. Note: DO NOT include the “[OR]” on the very last RewriteCond or your server will crash, delivering “500 Errors” to all page requests.
# deny access to evil robots site rippers and offline browsers
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* – [F,L]
You can also include specific referrers to a blacklist by using HTTP_REFERER. We used the scumbag domain, “iaea.org” as the blocked example, and we used “your-main-domain” as your domain (the domain being blocked is: iaea.org):
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$
RewriteRule !^http://[^/.].your-main-domain.com.* – [F,L]
We will work on updating this with more options and tricks, but for now, this will get you started.
Need hosting? Check our web hosting plans here, starting as low as $1.99 a month!