Strange scenario here: While developing a new website under a temporary domain (www2.icc.or.at) the External links module worked fine - i.e. only links to other domains have been treated as external.
Recently, the development site got live at its official domain (www.icc.or.at). That switch suddenly caused the External links module to treat *all* links as external! I tried to disable the module and wanted to apply the uninstall routine (but it does not have one), so I just re-enabled it, reset its settings to default, flushed all caches, but nothing helped. Whenever I tick the "Add icon to external links" checkbox (at admin/settings/extlink) - all links get the icon! Thus, I currently can no longer use this module at all.
Any ideas??
Comments
Comment #1
roball commentedAs a workaround, also ticking the "Consider subdomains internal" checkbox stopped treating all the (in fact internal) links as external. However, I would prefer not to treat subdomains as internal, since we have external sites using subdomains such as df09.icc.or.at.
Comment #2
quicksketchThe problem is because in your particular situation, External Links cannot identify which part of the domain is the top level domain, to domain name, and subdomains. External Links uses pattern matching to determine each of these pieces, but in your situation, the domain name is too short for it to figure it out correctly. I've tried making the regex universal in the past, but it's pretty tricky working with short domain names like that. The current regex works on 99% of sites (just an estimate), but domain names as short as yours fall into the unfortunate 1% exception. I'd be happy to look at patches or suggestions.
Comment #3
roball commentedI don't understand why the length of the domain name plays a role for matching for equality. Didn't look into the module's code yet, however, to check your regex. If it only works on 99%, then I would say it is wrong because it should be 100%.
Comment #4
quicksketchWell like I said, I tried to get it working before (a few different times). Obviously 100% is better than 99% and if you can come up with a 100% working regex I'd be happy to apply the changes.
Comment #5
quicksketchRegarding *why* the domain name length matters, say you have a the following domain names:
How would you know that "abc" is the name of the domain in both these examples? It's extremely hard to know that "abc" is not a second-level domain underneath the top-level categorization of "fr". So currently extlink makes assumptions that the domain name is longer than 3 characters and assumes shorter lengths to be part of the top-level (or secondary-level) domain.
Comment #6
quicksketchUntil a valid solution is suggested here (preferably via a patch), I don't think there is any practical solution to be implemented here.
Comment #7
zeta ζ commentedWhat about an admin setting, set to (in roball’s case)
icc. Then extlink will know the bit before is the subdomain, and the bit after is the tld?Won’t need setting if module can guess.
Comment #8
tebb commentedAny mileage in an (optional?) setting containing a list of "domain roots" (not necessarily domains) to be considered as internal?
e.g.
I guess that this is more like a list of 'domains considered trusted' (so not requiring a visual indicator or warning) than 'internal'.
Comment #9
quicksketchYou can always add a regex to make special "inclusions" to be considered internal using existing fields for Inclusions at admin/settings/extlink.
Comment #10
tebb commentedOops. Missed those collapsed settings! Thanks.
Comment #11
randallknutson commentedJust ran into this issue. Here is the regex I used to get around it in the "Exclude Links Matching the Pattern" field.
^(http:\/\/|https:\/\/)(www\.)?abc\.com(\/)?Comment #12
elachlan commentedAs state in #11 - you can use the "Exclude Links Matching the Pattern" field to exclude those domains. This should fix problems of this nature.
Comment #13
kip stanning commentedthx a lot, guys, for your work. @randallknutson: your regex #11 helped instantly!