diff --git a/boost.module b/boost.module index 64d07ac780c53ab17297f402690605702aa980ad..4831921580851e13afcdc39a03e62261230b5458 100644 --- a/boost.module +++ b/boost.module @@ -92,9 +92,12 @@ function boost_init() { // TODO: check interaction with other modules that use ob_start(); this // may have to be moved to an earlier stage of the page request. if (!variable_get('cache', CACHE_DISABLED) && BOOST_ENABLED) { + // We only support GET requests by anonymous visitors: global $user; if (empty($user->uid) && $_SERVER['REQUEST_METHOD'] == 'GET') { - if (boost_is_cacheable($_GET['q'])) + // Make sure no query string (in addition to ?q=) was set, and that + // the page is cacheable according to our current configuration: + if (count($_GET) == 1 && boost_is_cacheable($_GET['q'])) ob_start('_boost_ob_handler'); } } diff --git a/htaccess/boosted.txt b/htaccess/boosted.txt index 1e719e3a3229d0bfbe2d87c9a0ae222e5cfc78fe..f89b08425d387149d9df766be366feae58eceba4 100644 --- a/htaccess/boosted.txt +++ b/htaccess/boosted.txt @@ -90,17 +90,17 @@ DirectoryIndex index.php RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{QUERY_STRING} ^$ - RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI} -d - RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI}/index.html -f - RewriteRule ^(.*)$ cache/%{HTTP_HOST}/0/$1/index.html [L] + RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI} -d + RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}/index.html -f + RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1/index.html [L] RewriteCond %{REQUEST_URI} !^/cache RewriteCond %{REQUEST_URI} !^/user/login RewriteCond %{REQUEST_URI} !^/admin RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{QUERY_STRING} ^$ - RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/0/%{REQUEST_URI}.html -f - RewriteRule ^(.*)$ cache/%{HTTP_HOST}/0/$1.html [L] + RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}.html -f + RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1.html [L] # BOOST END # Rewrite current-style URLs of the form 'index.php?q=x'.