Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2006
    Thanked 1 Time in 1 Post

    Password protect site/hide from search engines

    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...

  • #2
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Thanked 49 Times in 48 Posts
    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 with sessions will do it.
    Last edited by Redcoder; 10-24-2012 at 08:34 PM.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts