How To Password Protect A Website
Ranked #1,942 in How-To, #19,531 overall | Donates to Save the Children
How To Password Protect A Website
Firstly, check out your website control panel. If your website host is using the popular CPanel then you'll find an option to password protect directories. This gives you the simplest and quickest way: just put all your files that need protection in a folder and set the password.
The only snag with this is that you either have to use the same password for all users or you need to create a user name for each person you want to allow access to your folder. Fine for a small number of users, a pain in the neck for lots of them.
If your control panel doesn't have the option to password protect directories or you'd rather not mess around with this, check out this easy to use software that will do all the password protection for you.
How To Encrypt HTML Web Page Source
Whilst it is possible to use things like Javascript to disable people from right clicking their mouse on your web pages, this isn't much use. You can't disable the "View source" menu option on their browser.
You can make it difficult for a human to make sense of your source code by removing all line breaks with an HTML compressor - this makes your source code one (very) long line and will put off the casual source code thief. But a determined one would just write a quick program to add the line breaks back in.
The alternative is to use a program to encrypt your web page HTML source code in such a way that it can be interpreted OK by a web browser but all a human will see is a screen of gibberish.
One such program can be found here.
The advantage of using software is that it's brain dead easy. So long as you can locate a file on your hard drive and click a mouse, you can encrypt an HTML file, add password protection to a page, stop people from stealing your images and hide your affiliate links so that your customers won't know that you're making money from them.
Could you do this on your own?
- Encrypting your HTML - you'd need to write your own software to do this.
- Protecting your images - you can stop people linking to them but not much more.
- Password protecting a page - yes, using your .htaccess file so long as you're using a Unix-based host.
- Hiding affiliate links - there are programs out there such as Cloak and Tracker which will also keep count of your clicks and give you helpful stats.
- Stop your email being grabbed by spammers - there are Javascript programs you can use for this.
- Stop your website being framed - again, this can be done with Javascript.
At the end of the day, it's your decision and how much you value your time. You can then decide whether to spend hours searching for the various tools and testing whether they work as claimed or you can spend a few dollars on tried and tested software to do it for you.
What's Your Biggest Reason To Protect Your Web Page HTML?
How To Password Protect Web Pages
You should store these in a separate directory on your website.
Make sure that this directory has an index page in it otherwise, depending on your host, your users may be presented with a list of your pages.
Also use your robots.txt file to prevent any search engine robots from finding and indexing files in the directory. Be especially careful to exclude Alexa as well as the main search engines like Google and Yahoo.
Whilst you can password protect web pages using instructions available on the web, this takes time to produce and check. My personal view is that it's easier to use ready-made software to do this task unless you're 100% sure that what you're doing will work with every available web browser (not just Internet Explorer and maybe Firefox) and that all options have been covered. I've had too many occasions where I've made a simple typo and messed up the protection I was trying to make. But if you're totally confident you can get your work completely right and that you can do it quicker than spending a few dollars on some software, feel free to go ahead!
Creating Web Pages For Dummies
Creating Web Pages For Dummies, 8th Edition
Amazon Price: $16.49 (as of 07/10/2009)![]()
Chances are, you're already a Web user and use the Internet on a regular basis. You've probably seen a few impressive Web sites and now you're inspired to create a Web page of your own, but you're not sure where to start. The answer is: right here!
Using .htaccess
In several web servers (most commonly Apache), .htaccess (hypertext access) is the default name of a directory-level configuration file that allows for decentralized management of web server configuration. The .htaccess file is placed inside the web tree, and is able to override a subset of the server's global configuration; the extent of this subset is defined by the web server administrator. The original purpose of .htaccess was to allow per-directory access control (e.g. requiring a password to access the content), hence the name. Nowadays .htaccess can override many other configuration settings, mostly related to content control, e.g. content type and character set, CGI handlers, etc.
In the Apache web server, the format of .htaccess is the same as the server's global configuration file; other web servers (such as Sun Java System Web Server and Zeus Web Server) implement the same syntax, even though their configuration files are very different. Directives in the .htaccess file apply to the current directory, and to all sub-directories (unless explicitly disabled in the server configuration), but for reasons of performance and security, cannot affect their parent directories.
The file name begins with a dot because dot-files are by convention hidden files on Unix-like operating systems.
Share Your Tips On Protecting Your Website Source and Images
Like this lens? Want to share your feedback, or just give a thumbs up? Be the first to submit a blurb!

