Flarum currently doesn't make any distinction between the types of links in a post, all are considered "user generated content", and as such have the nofollow
tag added to them. So it's not really a bug, just a missing feature.
It would probably be useful to other extensions outside of the rel
attribute if Flarum could also add a special attribute/class to those links to mark them as internal links.
This also ties in with the fact Flarum doesn't route those internal links inside of the single page app. If we implement a way for Flarum to recognize internal links, we should also make them route the SPA without refreshing the page (I believe an extension was created to address this particular issue in the past)
Hari otherwise core should not add this
The reason this is the built-in default is because it's a recommended best practice to apply nofollow
on user generated content, this prevents the feature being abused to promote external websites by spamming links. Until internal link recognition is implemented in Flarum, this is the safer default to apply to all links.
There's another aspect to this, just recognizing internal links based on domain/subfolder might not be enough. Removing nofollow
from dead internal links could cause SEO downsides as well. Bad actors could spam unique 404 links, causing search engines to be slowed down and taking longer to index useful pages. This part is definitely too difficult to be handled in core. All internal links in a post should be checked for validity on save to decide which links should be dofollow
.
Probably not as bad is also consideration for forums with private content. Some tags could be only visible to logged in members, the replies could be hidden from guests, etc. Having dofollow
links to those pages from publicly available pages could also result in negative SEO from search engines constantly hitting protected pages.
Because of those last 2 aspects, I'm not sure internal links should have dofollow
by default. This might be best as a setting, so forum owners have better control on the impact it will have on their SEO.
I'm sure those points were already raised in a previous discussion.
With a sitemap enabled, having dofollow or nofollow on user generated content shouldn't matter too much, or does it? I have never tested or seen any report on the best practice from that point of view.
One other thing I remember from a previous discussion on the subject was the question of external known hosts. Someone willing to enable dofollow
on links might likely want to enable it not only on forum links, but also links to their main non-forum website or other websites they manage. This quickly gets very complex for something in core. This part would be best handled by an extension, and as such the whole dofollow
feature could belong in that same extension. The only thing core should do is make sure extensions can remove the nofollow
rel
tag (I'm not entirely sure extensions can do it at the moment because it gets added very late in the rendering lifecycle).