View Full Version : Password protect site/hide from search engines

Subyne Simean
10-23-2012, 10:46 PM
Hi all,

I'm working on a webpage for my employer. It needs to be password protected, and invisible to search engines. I'm just wondering if there's some script that will accomplish this, as I'm rather noobish. I have managed in the past to cobble together a purchase history page with PHP and MySQL but that was a few years ago.

I can follow instructions, just don't know how to write scripts.

The username should be the same for all users.

I'd like to be able to set and modify a guest password (if someone at my work doesn't have their own email account, they can access the webpage but I can change the guest password each time someone leaves the company).

I'd like users to sign up via email verification - but only allow emails from a specific domain, like @myemployer.com

Would I need to use such a script on each page that I want protected?

Sorry if these are noob questions...

10-24-2012, 06:36 PM
Search Engines honor the conditions in the Robots.txt file, you can use it to block specific user agents. So you can even block a specific search engine because each search engine has a user_agent string like 'YahooSpider'.

So to block all search engines:
Make a robots.txt file and put it in the root of the web server - e.g public_html. Then write this starting from the first line:

User-agent: *
Disallow: /

To password protect it, basic HTTP authentication (http://php.net/manual/en/features.http-auth.php) with sessions will do it.