The discussion revolves around a bug in Discourse’s admin setting “add rel nofollow to user content,” which incorrectly applies rel="nofollow" to links pointing to the parent domain (e.g., www.discourse.org from try.discourse.org). Users report the issue and debate the correct behavior: whether subdomains of the parent domain should be followed by default. codinghorror and sam highlight inconsistencies, while eviltrout identifies the flawed code logic (uri.host.ends_with?(site_uri.host)). techAPJ submits a fix via GitHub PR #3501, addressing edge cases like example.co.uk and myblog.blogspot.com. michaeld points out lingering issues with public suffixes, prompting techAPJ to adopt the publicsuffix-ruby library. Concerns arise over dependency bloat (sam), leading to proposals for a new site setting like follow_links_domains (techAPJ, sam) to explicitly define allowed domains. codinghorror advocates simplicity: use known domain suffixes (e.g., discourse.org, example.co.uk) and default to strict nofollow if unspecified. lovechopra1 confirms the fix works for new content but requires rebaking old posts via rake posts:rebake (codinghorror). A newbie (Aaron_Seminoff) asks about duplicate content handling, with riking suggesting Discourse’s embedding feature as a solution. The core resolution involves refining domain matching logic and adding explicit configuration for followable domains.
There is a setting in Admin panel: add rel nofollow to user content: Add rel nofollow to all submitted user content, except for internal links (including parent domains). If you change this, you must rebake all posts with: “rake posts:rebake”
This setting is by default checked but all the links of parent domain is putting up with nofollow attribute.
Please use following steps to replicate:
1 Go to admin panel and search for setting “add rel nofollow to user content”, just to make sure it is checked
Speaking for Sitepoint, I could see use out of it with our article integration. Having sitepoint articles followed by default would make a lot of sense and in our case it would be community.sitepoint.com matching www.sitepoint.com
I would think other article integrated sites would see value in it too.
Also there was bug when domain like foo.com is added in exclude_rel_nofollow_domains setting, then domain like nofoo.com was also being allowed to be excluded from nofollow. Fixed that too.
Known domain name suffix of site should be used, e.g.
example.com example.co.uk example.website
With the rule being “any domain name with a dot plus this suffix is followed”
If necessary add another site setting to hold this value. If the value is not present, the nofollow will simply not be as accurate, e.g. it will nofollow stuff that it technically should not. It errs on the side of caution.
That’s much preferable to a giant library dependency…
Worst case, default to the discourse domain, that way, once added, it only no-follows internal links; ie: community.sitepoint.com, and we’d have to make it more generic by changing it to sitepoint.com