Allow domain aliases to be tracked by statistics module

Created on 17 April 2004, over 20 years ago
Updated 7 June 2024, 6 months ago

We had the problem on our site that our Drupal powered service is available under different domain names (due to historical and backward compatibility reasons). This is not too uncommon, it can be as simple as http://(www.)drupal.org being different. The current statistics code checks for internal and external referrers by the single $base_url set in the configuration. The $base_url is a fully qualified URL, so you have a choice to specify http://www.drupal.org/ or http://drupal.org/ (to keep the example). Therefore the internal/external referer check will not take the other domain(s) into account.

The attached patch was made against 4.4.0 CVS, but also applies cleanly to CVS. It adds a configuration option to the statistics module admin screen to specify domain name aliases, which will also be treated as internal addresses. I am unsure, whether this extra piece of information will be useful for other modules, so I have not added this into the system settings, but to the statistics settings. Patch tested and seems to be working fine on our 4.4.0 site (running on latest 4.4.x CVS code).

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024