Site appearance is sensitive to www, non-www or IP-address access to site

Created on 31 January 2017, over 8 years ago
Updated 2 May 2025, 8 days ago

I am running a D7 website on an Ubuntu 12.04 VPS (yes, yes, I know, I am in the process of migrating to a newer distro).

Through .htaccess I have set the "www" requests to resolve to the "non-www" version of the site and I have observed the following strange behavior:

  1. For a short time, due to a migration, my registrar had a broken DNS database, so my website was only accessible through its IP address. This entirely broke the theme. The site was still accessible and functioning if you knew the IP address, but it looked horrible. Once the DNS records were corrected, so was the appearance of the site.
  2. Probably due to an oversight during an update, I left the default .htaccess file, so the "www" site was once again accessible. In that case, the site looked correct, and the theme was functioning, but the fonts were not correct.

I cannot even start to imagine why domain name resolution would affect a theme and fonts appearance.

Some more details:

  • In my install, I use a bought theme which I have installed at sites/all/themes/mytheme, and which I have used to create my sub-theme at sites/all/themes/mytheme_subtheme.
  • For fonts, I use @font-your-face, and I have locally uploaded all necessary
  • The $base_url value in my settings.php file is the non-www, i.e.
    $base_url = 'http://mysite.org';
    
  • PHP 5.6 and 7.0 gave the same behavior
  • MySQL 5.5.53 (currently) but issue may have impacted previous updates
  • I use the securepages module to direct traffic to http (visitors) and https (admin) pages
  • Currently on D7.52 downloaded with drush, but issue impacted several previous versions
πŸ’¬ Support request
Status

Closed: outdated

Version

3.13

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡·Greece thanasis57

Live updates comments and jobs are added and updated live.
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