# Add rel="nofollow" admin setting is not working right, its making parent domain link as nofollow

**URL:** <https://meta.discourse.org/t/add-rel-nofollow-admin-setting-is-not-working-right-its-making-parent-domain-link-as-nofollow/29226>\
**Category:** Feature\
**Created:** [2015 年5 月 25 日 18:50 UTC](https://meta.discourse.org/t/add-rel-nofollow-admin-setting-is-not-working-right-its-making-parent-domain-link-as-nofollow/29226 "2015-05-25T18:50:08Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

作者： ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)\
发布日期： [2015 年5 月 26 日 07:13 UTC](https://meta.discourse.org/t/add-rel-nofollow-admin-setting-is-not-working-right-its-making-parent-domain-link-as-nofollow/29226/11 "2015-05-26T07:13:47Z")

</div>

It’s not that simple.

```
uri_domain = uri.host  
uri_domain = "#{uri.host.split('.')[1]}.#{uri.host.split('.')[2]}" if uri.host && uri.host.split('.').size == 3  
uri_domain = "#{uri.host.split('.')[1]}.#{uri.host.split('.')[2]}.#{uri.host.split('.')[3]}" if uri.host && uri.host.split('.').size == 4  

```

This code fails when people use naked ccSLD’s like `example.co.uk` (will follow everything in `co.uk`).

Also `myblog.blogspot.com` will follow everything at `blogspot.com`…

You should use [View the Public Suffix List](https://publicsuffix.org/list/) to resolve this…

---

_[View the full topic](https://meta.discourse.org/t/add-rel-nofollow-admin-setting-is-not-working-right-its-making-parent-domain-link-as-nofollow/29226)._
