This may seem like a no-brainer to some of you, but people do ask. If you are planning to include password-protected pages on your website, pages that users cannot access unless they are privileged and know the secret password, then you need not worry about the on site search engine optimization those pages. Pages that are password protected won’t be crawled or indexed by the search engines because search robots can’t fill out the password data to get in.
But there are a few things that you do need to consider when creating password-protected pages.
- First, to create the password protected pages you need two things: an .htaccess file and an .htpasswd file.
- Your .htpasswd file needs to be located outside of your websites main root on the server and includes only your login and password information for the password-protected pages (HINT: If you have more than one password protected area or different levels of membership that require different passwords, you’ll want to have the passwords for those areas in separate files).
- Your .htaccess should be located in the password-protected area (what information goes in this is for another blog post).
- One thing you don’t need for password-protected pages – if you’ve used your .htaccess and .htpasswd files correctly – is a robots.txt file; typically this file can be used to disallow search robots from crawling certain pages, but that’s what your .htaccess file does so it isn’t necessary for password-protected pages.
If at some point you think you might take away the password protection on your pages then you might optimize those pages so that you don’t have to rewrite them later, but it isn’t necessary while pages are protected. I hope this helps to clarify certain issues around password protection.