Outgoing Links Warning Page
-
Sorry if I create another post in this little span of time, but these are two totally different topics ^^
So, my site is structured like this:
domain.ltd
has a ghost blogforum.domain.ltd
has NodeBB
The problem is that if I activate the
Outgoing Links Warning Page
, and I put in the navigation the home link asdomain.ltd
, NodeBB will recognize it as an external page.There is some way to change this?
Thanks,
Luigi -
Try adding this to your Custom HTML inside a script tag:
utils.isInternalURI = function (targetLocation, referenceLocation, relative_path) { return targetLocation.host === '' || ( targetLocation.host === referenceLocation.host && targetLocation.protocol === referenceLocation.protocol && (relative_path.length > 0 ? targetLocation.pathname.indexOf(relative_path) === 0 : true) ) || (function () { var arr1 = referenceLocation.host.split('.'); var domain1 = arr1[arr1.length - 2] + '.' + arr1[arr1.length - 1]; var arr2 = targetLocation.host.split('.'); var domain2 = arr2[arr2.length - 2] + '.' + arr2[arr2.length - 1]; return domain1 === domain2; })(); }
This will disable outgoing links page if the outgoing link is of the same domain name.
-
@Giggiux oops. Sorry. Edited my post, try it now.
-
@PitaJ The function works (returns
true
), but now instead of going tohttp://domain.tld
, goes onhttp://forum.domain.tld/http://domain.tld
since NodeBB add the/
before, and i cannot remove it because if there are links to local pages like/categories
the/
it's gonna be removed and nothing works -
@Giggiux hmm okay let me try something else