How to use no-follow for all links in mysite in general ?

Discussion in 'PHP' started by duperhost, Apr 9, 2009.

  1. #1
    I am using few banner exchange and some text exchange services in my site also some text

    I want to make it in general that has no-follow for all links in my site how i can do it ?
     
    duperhost, Apr 9, 2009 IP
  2. oondraa

    oondraa Peon

    Messages:
    4
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    google: nofollow meta
     
    oondraa, Apr 9, 2009 IP
    duperhost likes this.
  3. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #3
    you mean i should Google this keyword ?
     
    duperhost, Apr 9, 2009 IP
  4. gastongr

    gastongr Well-Known Member

    Messages:
    421
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Put this is your document's head

    Notice that internal links will not be followed neither
     
    gastongr, Apr 9, 2009 IP
    duperhost likes this.
  5. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #5
    Thank you ;)

    I can make site map page and sitemap for Google (HTML) it will follow the links right ?
     
    duperhost, Apr 9, 2009 IP
  6. gastongr

    gastongr Well-Known Member

    Messages:
    421
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #6
    No links in the page containing the code i posted will be followed.

    However if you make a google (XML) site map or link the pages from other indexed websites they will be indexed.
    If you don't want the pages to be indexed then use

    <meta name="robots" content="noindex,nofollow">
     
    gastongr, Apr 9, 2009 IP
  7. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #7
    No i want my pages to be indexed, I mean outside links other then domains, some sites have this features that's anyone post a link they can but have no follow but all links from domain is follow, like craglist
     
    duperhost, Apr 9, 2009 IP
  8. gastongr

    gastongr Well-Known Member

    Messages:
    421
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #8
    If you want to allow SEs to follow internal links but not external ones you need to specify which ones should not be followed in the link code.

    Don't put anything in the head so all the links are followed, then in the ones you don't want to be followed add rel="nofollow" like this:

    <a href="http://www.externalwebsite.com/" rel="nofollow">External Site</a>
     
    gastongr, Apr 9, 2009 IP
  9. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #9
    In that case you'll need to use regular expressions to add it to user-supplied links. I recommend breaking the links down completely and re-building them from scratch, in order to better avoid XSS and other nefarious attacks on your users and admins.
     
    SmallPotatoes, Apr 9, 2009 IP
  10. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #10
    Is there is a way to make links no follow in general by using this :

    but choosing the links that follow by manual ?
    or its not correct method ?
     
    duperhost, Apr 9, 2009 IP
  11. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #11
    Help me please.. is the below code is correct method ?
     
    duperhost, Apr 10, 2009 IP
  12. gastongr

    gastongr Well-Known Member

    Messages:
    421
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #12
    duperhost, this code:
    refers to all the links in the page. Google help

    If after that you put rel="follow" in individual links it will not work as there is no such thing as rel="follow".

    I guess you want to use rel="follow" because you have control over your internal links and can apply that property to every link, but can't apply rel="nofollow" to external links because they are posted by users.

    If that's the case you will need to modify your script so that it will include rel="nofollow" in user posted links...
     
    gastongr, Apr 10, 2009 IP
  13. duperhost

    duperhost Well-Known Member

    Messages:
    817
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #13
    How i can do it with htaccess ?
     
    duperhost, Apr 16, 2009 IP