doutou7286 2014-05-23 05:56
浏览 63
已采纳

如何在具有多个域的godaddy共享服务器中创建robot.txt

Good afternoon, I hope you can help me, I have a question:

I have a server with godaddy (delux-sharing), on this server I have the following:

/
--/mail
--/etc
--/public_html
----/web1
----/web2
------/index.php
------/css
------/img
------/js
----/web3
--/tmp

I am creating a robot.txt file in which I want NO indexing anything in web2, refieron me with nothing to everything (index.html, css, img, js), but YES want to index the other pages (web1, web3) how can I accomplish this? robot.txt file in that folder have to go? in /, /public_html, /web2?

I could help with the file contents: robot.txt?

Thank you very much in advance.

  • 写回答

2条回答 默认 最新

  • duanao2585 2014-05-23 06:05
    关注

    You'll use two different robots.txt files. One goes into /web1 and the other goes into /web2. As far as crawlers go, if /web1 is the root of 'somedomain.com' they will not be able to crawl up a folder and on to the /web2 folder (or any other folder on the same level).

    Edit: Some sample robots.txt files

    To exclude all robots from the entire server (where "server" == "domain")

    User-agent: *
    Disallow: /
    

    To allow all robots complete access

    User-agent: *
    Disallow:
    

    (or just create an empty "/robots.txt" file, or don't use one at all)

    To exclude all robots from part of the server

    User-agent: *
    Disallow: /cgi-bin/
    Disallow: /tmp/
    Disallow: /junk/
    

    To exclude a single robot

    User-agent: BadBot
    Disallow: /
    

    To allow a single robot

    User-agent: Google
    Disallow:
    
    User-agent: *
    Disallow: /
    

    So, /web2 would get a robots.txt file with:

    User-agent: *
    Disallow: /
    

    and /web1 and /web3 would get empty robot.txt files or

    User-agent: *
    Disallow:
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于OPENCV的人脸识别
  • ¥20 51单片机学习中的问题
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题
  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!