Simple question about robots.txt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EN1GMA
    Confirmed User
    • Nov 2005
    • 1258

    #1

    Simple question about robots.txt

    Hi,

    Maybe someone can help me with a little question that I have about robots.txt

    So doing a site:domain.com on google.com I found many search results that I don't want to appear.
    All links are:
    http://www.domain.com/foldername/filename.php

    I added this to my robots.txt, please let me know if is correct:
    Code:
    User-agent: *
    Sitemap: http://www.domain.com/sitemap.xml
    Disallow: /link/
    Disallow: /link/*.php$
    Is better to use both of them?
    Or one of this lines is enough?
    If yes, whats line is better?

    After doing this, is better to use webmaster tools to say google to remove that links from search results?
    I think that they have this option right? If is a good idea, can you please teach me by saying the steps that I need?

    Thank you guys!

    Best regards!
  • PornCious
    Registered User
    • Nov 2012
    • 50

    #2
    Disallow: /link/ [this will block all files within this directory]
    Disallow: /link/*.php$ [this will block all .php files within this directory]

    Best is to try and test it within Webmaster tool.

    Cheers!

    Comment

    • EN1GMA
      Confirmed User
      • Nov 2005
      • 1258

      #3
      Thank you for your reply buddy.

      But Webmaster Tools don't give any good help... he ignores the disallow lines.
      Screenshot: http://i.imgur.com/YDJmyI5.png

      Comment

      • PornCious
        Registered User
        • Nov 2012
        • 50

        #4
        well, looks like you tried your root domain during testing. You need to try yourdomain dot com / links / yourphpfile.php to verify whether your robot.txt is working the way it's suppose to. You want to block .php files within link dir and not entire domain, correct?

        Comment

        • dunhill
          Confirmed User
          • Jul 2013
          • 89

          #5
          Better add the noindex metatag on your disallowed files. robots.txt is accessible to everyone and the users can see the disallowed files there.Or block the googlebot user agent from .htaccess

          Comment

          • AMSM

            #6
            <meta name="robots" content="noindex, nofollow">

            Comment

            • Tent Pitcher
              Confirmed User
              • Nov 2012
              • 213

              #7
              Originally posted by EN1GMA
              Hi,

              Maybe someone can help me with a little question that I have about robots.txt

              So doing a site:domain.com on google.com I found many search results that I don't want to appear.
              All links are:
              http://www.domain.com/foldername/filename.php

              I added this to my robots.txt, please let me know if is correct:
              Code:
              User-agent: *
              Sitemap: http://www.domain.com/sitemap.xml
              Disallow: /link/
              Disallow: /link/*.php$
              Is better to use both of them?
              Or one of this lines is enough?
              If yes, whats line is better?

              After doing this, is better to use webmaster tools to say google to remove that links from search results?
              I think that they have this option right? If is a good idea, can you please teach me by saying the steps that I need?

              Thank you guys!

              Best regards!
              You don't need the second disallow as access to /link will be blocked based on the first disallow.

              As far as Webmaster Tools, it wouldn't hurt to remove the links there as well, but I wouldn't do it instead of robots.txt (there are plenty of other sites that could potentially index the content). I would, however, upload your sitemap to Webmaster Tools if you haven't already.
              Tent Pitcher - Adult Search Engine

              Comment

              Working...