nofollow - How to attach sitewide to ONLY a certain domain

Discussion in 'Search Engine Optimization' started by EducationLinks, Jul 26, 2007.

  1. #1
    Does anyone know how to attach a sitewide "nofollow" tag to ONLY one, particular domain? I'm having a problem with a handful of people posting links to the same few sites, and I think it is affecting my SEO rankings. I do not want to have to use global nofollow against all domains, just the couple of trouble-makers.

    Please advise.
     
    EducationLinks, Jul 26, 2007 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know if it's possible, to be honest. Then again, I may be misunderstanding your situation and question.
     
    Dan Schulz, Jul 26, 2007 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    In most program languages, that is done with a simple "if" statement.
    What language are you using on your server to generate that links ?
     
    ajsa52, Jul 26, 2007 IP
  4. Obelia

    Obelia Notable Member

    Messages:
    2,083
    Likes Received:
    171
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Yes, it can be coded. You will need a regular expression to figure out whether the url is from a certain domain.

    Additionally, you might want to consider using a regular expression to test for dodgy domains (ones with porn keywords, for instance, or anything at all you don't want to be seen linking to). That way you can nofollow links for all kinds of things that would be likely to cause trouble. If you're doing it for one domain, you might as well save time and add a whole bunch of undesirable keywords to your list of urls to nofollow.
     
    Obelia, Jul 26, 2007 IP
  5. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #5
    you can try to make it with css file
     
    trichnosis, Jul 26, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #6
    CSS is a presentational markup language that compliments (X)HTML's structural markup language - it has absolutely nothing to do with blocking domain names.
     
    Dan Schulz, Jul 26, 2007 IP
  7. EducationLinks

    EducationLinks Well-Known Member

    Messages:
    1,193
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Here's my scenario:

    Aside from my forum, I also have another old site that has thousands of pages. They are NOT dynamiccally-generated pages. Each page has a separate html file. Now, on all of those pages, there are hyperlinked sites to which I no longer wish to pass PR.

    I'm hoping that someone can show me the exact code to place in .htaccess (if possible) that will put a "nofollow" tag on a particular domain throughout all of my thousands of pages.
     
    EducationLinks, Jul 26, 2007 IP
  8. Obelia

    Obelia Notable Member

    Messages:
    2,083
    Likes Received:
    171
    Best Answers:
    0
    Trophy Points:
    210
    #8
    AFAIK you can't do this in .htaccess. You may be thinking of mod_rewrite, but it doesn't work that way: it doesn't rewrite all the urls in your pages for you, just redirects one url to another. I know I've explained that very crudely, but I don't think .htaccess is your answer.
     
    Obelia, Jul 26, 2007 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ok, you're going to have to do a mass find/replace (one of the few times I suggest using something like Dreamweaver), but add rel="nofollow" to the links you want to block from the search engines.

    Here's an example:

    
    <a href="http://www.badwebsite.com" rel="nofollow">link to site you no longer want to be followed</a>
    
    Code (markup):
     
    Dan Schulz, Jul 26, 2007 IP
  10. WebGeek182

    WebGeek182 Active Member

    Messages:
    510
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    95
    #10
    To do it sitewide, you would need to be running a particular software CMS or custom software engine. Examples include: WordPress, vBulletin, etc. You'd need to code it into your server-side code (PHP, ASP, etc) that generates the links. If you have a central configuration include where you could specifiy your conditions, then that would make it easier to do.
     
    WebGeek182, Jul 26, 2007 IP
  11. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You can do it individually, but it'll take FOREVER if you do it all by hand.
     
    Dan Schulz, Jul 26, 2007 IP
  12. EducationLinks

    EducationLinks Well-Known Member

    Messages:
    1,193
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    140
    #12
    Yeah, that has always been my worst-case option. I can do it with BBEdit. The problem is that I have to download 40,000+ files, do the mass edits, and then upload the 40,000+ files back to the server. That literally takes all day. I was just hoping there was a quick fix option. :( Oh well, old school it is!
     
    EducationLinks, Jul 26, 2007 IP
  13. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #13
    You're using a Mac, right? If so, just go to www.adobe.com and download a trial version of Dreamweaver. Set up a "site" (that's what Dreamweaver calls a collection of files) and let Dreamweaver go through and edit your links to that domain so that the rel="nofollow" attribute is added via a mass edit.

    Should take no more than 5 minutes.
     
    Dan Schulz, Jul 26, 2007 IP