I have a multi site setup where files in the document root chdir to a drupal base directory. Similar to http://justinhileman.info/articles/a-more-secure-drupal-multisite-install

This means however that the file_get_contents('.htaccess') in boost.install is looking for the htaccess file in my base dir instead of the Apache document root.

Although the functioning of boost is not impaired, the status page complains about the .htaccess file not being properly updated.

My solution is to add dirname($_SERVER["SCRIPT_FILENAME"]) to the .htaccess filename as in the attached patch. This should, as far as I can tell, not pose a problem for other setups.

If it does, then please let me know so we can find a suitable solution.

CommentFileSizeAuthor
boost-htaccess_validation.patch624 byteshelmo

Comments

mikeytown2’s picture

Category: feature » bug
Status: Active » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jumoke’s picture

I have multisite install and have tried everything. The cached pages get created and my status report says i am fine, yet the pages don't get served. I get no boost at the bottom of my pagesource.

I followed the Justin Hileman's install and my drupal folder is the base directly like you have above. Is there anything you think i may be doing wrong?

Settings are:
%{HTTP_HOST}
%{DOCUMENT_ROOT}

I copied the code generated into an .htaccess in my multisite (exsitename) directory (not the drupal directory).
.htaccess as follows: please help.

  ### BOOST START ###

  # Gzip Cookie Test
  RewriteRule ^(.*)boost-gzip-cookie-test\.html cache/perm/boost-gzip-cookie-test\.html\.gz [L,T=text/html,E=no-gzip:1]

  # GZIP - Cached css & js files
  RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=2]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.css\.gz -s
  RewriteRule .* cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css,E=no-gzip:1]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.js\.gz -s
  RewriteRule .* cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript,E=no-gzip:1]

  # NORMAL - Cached css & js files
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.css -s
  RewriteRule .* cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
  RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.js -s
  RewriteRule .* cache/perm/%{HTTP_HOST}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]

  # Caching for anonymous users
  # Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
  RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
  RewriteCond %{HTTPS} on [OR]
  RewriteCond %{HTTP_COOKIE} DRUPAL_UID
  RewriteRule .* - [S=3]

  # GZIP
  RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=1]
  RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
  RewriteRule .* cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html,E=no-gzip:1]

  # NORMAL
  RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
  RewriteRule .* cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]

  ### BOOST END ###
helmo’s picture

Please open a new issue with the support category for this sort of question.

You can always refer to this issue if it seems relevant, but changing the topic of this issue is not really workable.