In some cases HTTP_HOST != site name. For example in my Apache configuration (behind reverse proxy) HTTP_HOST=www.roleplay.ru:80 — with port added to host. But boost creates directory from Drupal config: 'www.roleplay.ru'. As result - boost generates cache pages, but rewrite rules in .htaccess can't redirect to these pages.

Solution in my case (I think appropriated for others with same problem): use SERVER_NAME variable instead HTTP_HOST — you need replace all instances of %{HTTP_HOST} in mod_rewrite rules of .htaccess to %{SERVER_NAME}
Patch applied.

CommentFileSizeAuthor
boosted.patch.txt1.85 KBaxel

Comments

Arto’s picture

Assigned: Unassigned » Arto
Arto’s picture

Title: HTTP_HOST variable not everytime equals site name » HTTP_HOST doesn't always equal site name
Status: Needs review » Fixed

Dankegon, Axel. I've committed the essentials of your patch in CVS changeset [47150].

I think the patch is the right thing to do for the time being. However, I'm pretty sure that this is not going to be the last word on the issue, since I know some people are running complex multi-site setups wherein SERVER_NAME != $base_url, too. Possibly the correct way to solve this would be to ignore Drupal's $base_url and consistently create the cache directories based on the HTTP_HOST set in the request that caches the page (SERVER_NAME couldn't really be used in this case, since the same canonical SERVER_NAME may be in use for multiple different HTTP_HOSTs, so HTTP_HOST gives better granularity.) But, until somebody sends in a problem description containing particulars of such a setup, SERVER_NAME is probably going to work the best for most people.

Anonymous’s picture

Status: Fixed » Closed (fixed)