How to stop search engines from crawling the whole website?

后端 未结 3 1228
逝去的感伤
逝去的感伤 2021-02-05 10:05

I want to stop search engines from crawling my whole website.

I have a web application for members of a company to use. This is hosted on a web server so that the emplo

3条回答
  •  野性不改
    2021-02-05 10:57

    It is best handled with a robots.txt file, for just bots that respect the file.

    To block the whole site add this to robots.txt in the root directory of your site:

    User-agent: *
    Disallow: /
    

    To limit access to your site for everyone else, .htaccess is better, but you would need to define access rules, by IP address for example.

    Below are the .htaccess rules to restrict everyone except your people from your company IP:

    Order allow,deny
    # Enter your companies IP address here
    Allow from 255.1.1.1
    Deny from all 
    

提交回复
热议问题